java - SSO for Tomcat users with SPNEGO fails -
i have app running on tomcat server. app authenticates active directory using spnego
module.
steps take make setup work are:
- add
tomcat app
ad
domain - make
rest api
login call app.rest api
call perform authentication/authorization ad usingspnego
.
as part of brand new app initialization, start app first time , add app-host ad domain. make api call performs ad authorization fails following error.
type exception report:
message gssexception: failure unspecified @ gss-api level (mechanism level: invalid argument (400) - cannot find key of appropriate type decrypt ap rep - rc4 hmac) description server encountered internal error prevented fulfilling request. exception javax.servlet.servletexception: gssexception: failure unspecified @ gss-api level (mechanism level: invalid argument (400) - cannot find key of appropriate type decrypt ap rep - rc4 hmac) net.sourceforge.spnego.spnegohttpfilter.dofilter(spnegohttpfilter.java:238) root cause gssexception: failure unspecified @ gss-api level (mechanism level: invalid argument (400) - cannot find key of appropriate type decrypt ap rep - rc4 hmac) sun.security.jgss.krb5.krb5context.acceptseccontext(unknown source) sun.security.jgss.gsscontextimpl.acceptseccontext(unknown source) sun.security.jgss.gsscontextimpl.acceptseccontext(unknown source) sun.security.jgss.spnego.spnegocontext.gss_acceptseccontext(unknown source) sun.security.jgss.spnego.spnegocontext.acceptseccontext(unknown source) sun.security.jgss.gsscontextimpl.acceptseccontext(unknown source) sun.security.jgss.gsscontextimpl.acceptseccontext(unknown source) net.sourceforge.spnego.spnegoauthenticator.dospnegoauth(spnegoauthenticator.java:444) net.sourceforge.spnego.spnegoauthenticator.authenticate(spnegoauthenticator.java:283) net.sourceforge.spnego.spnegohttpfilter.dofilter(spnegohttpfilter.java:234) root cause krbexception: invalid argument (400) - cannot find key of appropriate type decrypt ap rep - rc4 hmac sun.security.krb5.krbapreq.authenticate(unknown source) sun.security.krb5.krbapreq.<init>(unknown source) sun.security.jgss.krb5.initseccontexttoken.<init>(unknown source) sun.security.jgss.krb5.krb5context.acceptseccontext(unknown source) sun.security.jgss.gsscontextimpl.acceptseccontext(unknown source) sun.security.jgss.gsscontextimpl.acceptseccontext(unknown source) sun.security.jgss.spnego.spnegocontext.gss_acceptseccontext(unknown source) sun.security.jgss.spnego.spnegocontext.acceptseccontext(unknown source) sun.security.jgss.gsscontextimpl.acceptseccontext(unknown source) sun.security.jgss.gsscontextimpl.acceptseccontext(unknown source) net.sourceforge.spnego.spnegoauthenticator.dospnegoauth(spnegoauthenticator.java:444) net.sourceforge.spnego.spnegoauthenticator.authenticate(spnegoauthenticator.java:283) net.sourceforge.spnego.spnegohttpfilter.dofilter(spnegohttpfilter.java:234) note full stack trace of root cause available in apache tomcat/6.0.36 logs.
this indicates spnego not able find key decrypt communication ad.
the problem goes away restart tomcat. after restart if tomcat, user can perform sso based authorization.
i checked keytab file , looks ok. using rc4-hmac encryption purpose. login.conf , krb5.conf configured correctly on host. ( after restart works fine )
i ran strace on tomcat pid see if spnego reads keytab file. appears tomcat/spnego calling stat on file, never opening it. tomcat/spnego thinks whatever it's cached still correct.
here's lines call:
7832 1431560872.430550 stat("/var/pgsql/sync-dir/samba/tomcat-user.keytab", <unfinished ...> 7832 1431560872.443416 <... stat resumed> {st_mode=s_ifreg|0600, st_size=894, ...}) = 0
i never see read though.
please let me know if has seen issue of spnego
caching information , problem goes away restart tomcat
Comments
Post a Comment