spring-security-kerberos icon indicating copy to clipboard operation
spring-security-kerberos copied to clipboard

Executing KerberosRestTemplate runs into "Unable to obtain password from user" error

Open ruchidalal opened this issue 8 years ago • 6 comments

I have setup the Kerberos environment as per the setup steps in the document here : [http://docs.spring.io/spring-security-kerberos/docs/1.0.2.BUILD-SNAPSHOT/reference/htmlsingle/#browserspnegoconfig]

I was able to run the spnego-form-auth samples. However on trying to run the rest example I run into this error - Caused by: org.springframework.web.client.RestClientException: Error running rest call; nested exception is javax.security.auth.login.LoginException: Unable to obtain password from user

    at org.springframework.security.kerberos.client.KerberosRestTemplate.doExecute(KerberosRestTemplate.java:196)
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:530)
    at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:237)
    at demo.app.Application.run(Application.java:28)
    at org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:677)
    ... 10 more

Caused by: javax.security.auth.login.LoginException: Unable to obtain password from user

    at com.sun.security.auth.module.Krb5LoginModule.promptForPass(Krb5LoginModule.java:897)
    at com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:760)
    at com.sun.security.auth.module.Krb5LoginModule.login(Krb5LoginModule.java:617)

Could you help me with it or let me know the exact steps of running the rest service example

ruchidalal avatar Mar 10 '17 11:03 ruchidalal

same problem here

jomach avatar May 24 '17 09:05 jomach

@jomach : Did you find a resolution this problem?

ruchidalal avatar Jun 16 '17 13:06 ruchidalal

I have activated the debug for that modules and I see a PBX... expection. No idea what it is.

jomach avatar Jun 20 '17 11:06 jomach

jomach can post how did you activated the debug. I have not found a solution yet. In case you have could you share it please.

courteous avatar Aug 01 '17 09:08 courteous

-Dsun.security.krb5.debug=true -Dsun.security.spnego.debug=true and KRB5_TRACE=/dev/stdout

jomach avatar Aug 01 '17 11:08 jomach

@courteous @ruchidalal: I had the same issue. This works fine. Check that you have -Djava.security.krb5.conf=/etc/krb5.conf and that the DEFAULT domain on the config matches what you need.

jomach avatar Aug 07 '17 06:08 jomach