Daniel Schulze wrote:
DS> Dan, Oleg, Folks
DS> I ve got your security stuff working and I walked through the code and think
DS> I understud the big picture.
DS> But there is one thing left, I still didnt get:
DS> Why does the JaasSecurityManagerService.getObjectInstance() method return a
DS> Context??? It ends up in a ClassCastException for me! With the following
DS> change it works fine:
DS> //return smContext;
DS> return smContext.lookup(smName);
DS> (in jboss.xml I set authentication to "jaas")
In jboss.xml you should set authentication to "jaas/entry1" and to
write in auth.conf:
entry1 {
MyLoginModule ...
}
or
other {
MyLoginModule ...
}
You can have multiple application entries in auth.conf,
say entry1, entry2,..., they would be referenced in jboss.xml as
jaas/entry1, jaas/entry2, etc. These names are bind to JNDI
dynamically: deployer tries to resolve "jaas/entry1", JNDI finds name
"jaas", which refers to JaasSecurityManagerService and asks it to
return the Context, then performs lookup("entry1") in the returned
context. Thus, the EJBSecurityManager/RealmMapping instances are
created lazily.
Best regards,
Oleg