Calling LoginModule in JBoss

M

Maciek

Hi,

I need some help in running authentication in JBoss.
I have a custom JAAS login module that handles SAML SSO
authentication.
A servlet calls the LoginModule upon receiving a SAML response
After calling LoginContext.login() I have a successfully authenticated
Subject.
Then I need to assign this Subject to session.

In WebLogic I can do:
// weblogic.servlet.security.ServletAuthentication
ServletAuthentication.runAs(subject, request);

How can it be done in JBoss ?
Here is a code snippet from the

if (/* request has cert */) {
cert = request.getAttribute("cert");
CallbackHandler handler = new CertCallbackHandler(cert);
LoginContext lc = new LoginContext("composer-saml-cert", handler);
try {
lc.login();
Subject subject = lc.getSubject();

// **** << assign subject to request >> **** !!!!!!!!!!!!!!!!!!

} catch(LoginException e) {
// XXXX
}
}

Thanks for any pointers,
Maciek
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top