The article 'http://www.javaworld.com/javaworld/jw-02-2002/jw-0215-ejbsecurity_p.html' says the following:
If you use the standard JBoss JaasSecurityManager to handle your security, then you can obtain the currently active JAAS Subject as an alternative to calling EJBContext methods. The subject is an instance of javax.security.auth.Subject that is set for the invocation. You can use JNDI (Java Naming and Directory Interface) to obtain a reference to it, as follows:
InitialContext ic = new InitialContext();
Subject subject = (Subject)ic.lookup("java:comp/env/security/subject");
I hope this helps.
Can anyone tell me why I get 'subject not bound' when I try the above approach?
[Default] javax.naming.NameNotFoundException: subject not bound
According to the jboss manual, jboss binds the subject. What am I missing?
I've used this code in a SLSB and it's worked OK so far.
The JavaWorld article is worth reading.
I am able to get subject. I get the principals but privateCredentials is null.
I use LDAP Login Module and I need to privateCredentials
what am I doing wrong ?