Skip to content

JbossWS and LdapLoginModule

October 7, 2009

Conclusions of study:

Simple ldap validation possible in jboss without authorization check.
Default LdapLoginModule has fixed structure of using principal suffix/prefix for DN formation for bind that may not be suitable
Custom Login module can be built either using CAS or simple JNDI.
Authorization can be customized.
Multiple login modules can be stacked using JAAS . [This needs to be explored further]

Two files need to be modified:
1. Login-config.xml
In this file we need to indicate the configurations of the ldap server as well as the principal suffix and prefix.

<application-policy name = "JBossWS">
<login-module code=""
                <module-option name="java.naming.factory.initial">
                <module-option name="java.naming.provider.url">
                <module-option name="">
   <module-option name="principalDNPrefix">id=</module-option>
<module-option name="principalDNSuffix">dc=com</module-option>

2. Jboss-web.xml

The security realm defined in this file is mapped to the application-policy name as mentioned in the login-config.xml file. This file is in the path /WEB-INF/ at the level of web.xml


3. Web.xml

The security constraint tag is mandatory – even if roles validation is not required. If authorization check is not required then give * in role-name. Similarly login-config tag is mandatory required.

      <web-resource-name>All resources</web-resource-name>

If a role validation is required then the security role name tag will be used for validation with user’s profile.


No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: