Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When connecting to SQL server via keytab warning shown as SPN not available in the keytab file #63

Open
poornics09 opened this issue Jul 24, 2019 · 0 comments

Comments

@poornics09
Copy link

poornics09 commented Jul 24, 2019

I have some doubts regarding generating a keytab file for SQL server kerberos authentication.

SQL server's SPN is:

MSSQLSvc/myhost:[email protected]

I have created keytab file as:

ktpass -out "C:\Users\myuser\KerberosConf\MSSQL\myappserver.keytab" -princ MSSQLSvc/myhost:[email protected] -mapUser mydomain\myuser-pass Test@123 -crypto AES256-SHA1 -pType KRB5_NT_PRINCIPAL

When viewing the keytab it shows the correct SPN as:

[1] Service principal: MSSQLSvc/myhost:[email protected]
KVNO: 18

But while referring the keytab file for authenticating it throws the below error:

Debug is true storeKey true useTicketCache false useKeyTab true doNotPrompt true ticketCache is null isInitiator true KeyTab is C:/Users/myuser/KerberosConf/MSSQL/myappserver.keytab refreshKrb5Config is false principal is MSSQLSvc/myhost:[email protected] tryFirstPass is false useFirstPass is false storePass is false clearPass is false Key for the principal MSSQLSvc/myhost:[email protected] not available in C:/Users/myuser/KerberosConf/MSSQL/myappserver.keytab

[Krb5LoginModule] authentication failed Unable to obtain password from user

javax.security.auth.login.LoginException: Unable to obtain password from user
at com.sun.security.auth.module.Krb5LoginModule.promptForPass(Unknown Source)
at com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Unknown Source)
at com.sun.security.auth.module.Krb5LoginModule.login(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Please kindly help me to resolve the message "Key for the principal MSSQLSvc/myhost:[email protected] not available in C:/Users/myuser/KerberosConf/MSSQL/myappserver.keytab"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant