Hi,

I'm not 100% sure if this is applicable, but I just found this:

  "Due to a design oversight in the JAAS 1.0, 
javax.security.auth.Subject.ge­tSubject() does not return the Subject 
associated with the thread of execution inside a 
java.security.AccessController­.doPrivileged() code block. This can 
present a inconsistent behavior that is problematic and causes 
undesirable effort. com.ibm.websphere.security.aut­h.WSSubject provides 
a work around to associate Subject to thread of execution. 
com.ibm.websphere.security.aut­h.WSSubject extends the JAAS 
authorization model to J2EE resources."

in this thread:

http://groups-beta.google.com/group/comp.lang.java.security/browse_thread/thread/3fbba23648cfb556/b736a3b0f27fc170?q=get+subject+loginmodule&rnum=21#b736a3b0f27fc170

If the above is applicable, then I don't know what the equivalent
workaround would be for Tomcat?

Jim



ohaya wrote:
> 
> Rogerio,
> 
> I've been wrestling with this exact same problem, but haven't had any
> more success than you have had thus far, so if you find out the answer
> to this, can you please post a msg here?  I'll do the same...
> 
> Thanks,
> Jim
> 
> Rogerio Baldini das Neves wrote:
> >
> >  Hi!
> >
> >  I'm using the Tomcat 5 JAASRealm for authenticating users with my own 
> > LoginModule.
> > In my LoginModule I am populating the Subject object delivered by the Realm 
> > with Principals, Role Principals and Credentials.
> >
> >  The authentication and the mapping of my user defined roles to tomcat 
> > roles work fine, but I can´t get a reference to the Subject object in
> >  my servlets.
> >
> > I have tried:
> >
> > AccessControlContext context = AccessController.getContext();
> > Subject subject = Subject.getSubject(context);
> >
> > But it´s not working... subject = null;
> >
> > Can anybody help me, please ?
> >
> > Rogerio.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to