Porting WebSphere code to get remote credentials to Tomcat
- by Glenn Lawrence
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.