hi all,
I have a servlet which is secured with a basic authentication method. When I request a secured resource, I am asked by a web container to introduce myself in a popup. This is the web tier authentication. After letting me in, I want to invoke a method on EJB. That is why I have to propagate the security context from web tier to EJB tier. As far as I learned from the forum, I have to do a JAAS login. The way JBoss people do it is:
Principal user = new SimplePrincipal(username);
SecurityAssociationHandler callbackHandler =
new SecurityAssociationHandler(user, password.toCharArray());
LoginContext loginContext = new LoginContext("OracleDbRealm", callbackHandler);
loginContext.login();