









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










To achieve all this, JAAS provides classes:
Subject sub = lc.getSubject(); Subject.doAs(sub, new MyPrivilegedAction()); private class MyPriviligedAction implements PriviligedAcion { public Object run() { try { /* Whatever code you want, call session beans … */ } catch (Exception e) {}; return null; } }
The JBOSS application server provides pluggable security managers The web and EJB containers use the security managers to perform authentication and authorisation The JAAS based security manager is the default security manager provided with JBOSS The JAAS security manager obtains the required configuration information from the login-config.xml file located in the conf folder The XML file provides a list of security domains that are available on the server. Each domain specifies a list of LoginModules that protect the domain To gain access to the resources protected by a domain, the client must be able to satisfy all the LoginModules that are configured as required
All the resources with the URL pattern /secure/* are protected, and the client must belong to the “Secure” role to access these resources <security-constraint>
During application packaging, the administrator must choose the security domain that will protect the application. This is specified in the JBOSS specific deployment descriptor jboss-web.xml. A sample file might be:
<method-permission> <role-name>Secure</role-name>
Out of the box, OurSpace security isn’t provided by JAAS, so how is user information taken into account? If you look, you will find the LoginFilter. This is not a JAAS module, but an Interceptor LoginFilter intercepts HTTP requests Information about current logged in users is kept in a Hashtable. You will find a StatelessSessionBeanCache in the code LoginFilter stores user profile data stored in the HTTP session object So when an action requires a profile, LoginFIlter intercepts, looks up user properties in the Hashtable, populates the HTTP session object with user profile data, then control passes back to the action One of the assignment tasks is to use JAAS to provide A&A services