Porting WebSphere code to get remote credentials to Tomcat
Posted
by
Glenn Lawrence
on Stack Overflow
See other posts from Stack Overflow
or by Glenn Lawrence
Published on 2013-10-20T21:52:27Z
Indexed on
2013/10/20
21:53 UTC
Read the original article
Hit count: 257
I have been asked to look into porting some code from a web app under IBM WAS 7 so that it will run under Tomcat 7.
This is part of a larger SPNEGO/Kerberos SSO system but for purposes of discussion I have distilled the code down to the following that shows the dependencies on the two WebSphere classes AccessController and WSSubject:
GSSCredential clientCreds = (GSSCredential) com.ibm.ws.security.util.AccessController.doPrivileged(new java.security.PrivilegedAction() {
public Object run() {
javax.security.auth.Subject subject = com.ibm.websphere.security.auth.WSSubject.getCallerSubject();
GSSCredential clientCreds = (GSSCredential) subject.getPrivateCredentials(GSSCredential.class).iterator().next();
return clientCreds;
}
});
I'd like to be able to do this in Tomcat.
© Stack Overflow or respective owner