13.07.2015 Views

IBM WebSphere V5.0 Security - CGISecurity

IBM WebSphere V5.0 Security - CGISecurity

IBM WebSphere V5.0 Security - CGISecurity

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

employeeType will be stored as a session attribute and used by other Webcomponents. Specify the employeeType attribute for the application users inthe LDAP directory.3. LDAP is configured to accept anonymous access.4. The example implemented in this book has the users defined in both localoperating system user registry and in the LDAP server. Users are registeredunder the o=itso suffix.Developing the LDAP query codeThe example filter included in the application code contains the following Javafiles.►►LDAPAttr.java is utilized to connect to the LDAP server and retrieve userattributes. Parameters that are passed to the class are set up in the filterconfiguration section in Web deployment descriptor and are passed to theconstructor of the class while it is created. The class implements the simplestway to read user attributes from the LDAP server.PostLoginFilter.java is the actual filter code that uses the LDAPAttr toaccess certain attributes in the LDAP directory. This class implements thedoFilter(request, response, filterchain) method. In this method, the actualfilter action is performed, which is also the method that the upstream filtercalls in order to pass the processing to the next filter in a chain. FilterChainobject provides the information about the next filter to call.The sample doFilter method does the following:a. Checks if the Web container successfully initialized the filter. The Webcontainer calls the init method of the filter to instantiate it.b. Reads the init parameters of the filter that have been provided in the section of the Web deployment descriptor.c. Gets the user name from the HTTP request object and creates the sessionattribute in the HttpSession object. This attribute is initially set toUNDEFINED.d. The filter lets the j_security_check perform the actions by calling thedoFilter method.e. After returning from j_security_check, the PostLoginFilter performs anLDAP search for the user name that was provided in the HTTP request tothe login form.f. After a successful search for the user in the LDAP directory, theemployeeType attribute is read for the user and the session object isupdated with the result.64 <strong>IBM</strong> <strong>WebSphere</strong> <strong>V5.0</strong> <strong>Security</strong> Handbook

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!