2.3 Integrating with LDAP/Active Directory

Viewpoint is equipped with pluggable security that easily handles integration with LDAP/Active Directory. Configuration for setting up LDAP authentication and authorization requires adding a login module entry into the login modules section in the core.xml file.

There are two factors you should take into consideration when setting up security via LDAP. First, you must have the required information about your LDAP server (in the following examples Active Directory will be used), and you must use that information to populate the necessary fields on your LDAP server.

When you select LDAP at the Security screen during Viewpoint installation, the core.xml file is automatically generated to include the login module, the permissions map, and a default, functional LDAP configuration; however, if you selected a different security method, you can manually configure Viewpoint to use LDAP/Active directory by completing the following steps:

  1. Open the core.xml file and specify the fully qualified class name in the <login-module> element (class attribute).
  2. Define the necessary options within the <login-module> element. Refer to the Login Module Example for more information.
  3. Add the appropriate callback parameters to the <request-handler> element. See the Request Handler Example for more information.
  4. Include the required principal type (LdapGroupPrincipal) in the <permissions-map> element. See the Permissions Map Example for more information.
  5. Complete the group and role permissions mapping configuration according to your own specific requirements. See Configuring the Authentication Module for more information; specifically note descriptions for the <permissions-map> and <role-definition> elements.

2.3.1 Class Name

The class name to be specified in the <login-module> element is com.cri.security.server.modules.LdapLoginModule.

Options for Defining LdapLoginModule

The following are options for defining the LdapLoginModule:

Note For all searches (userSearchMatching and roleSearchMatching), RFC 2254 filters are allowed.

2.3.2 Login Module Example

The following is an example LdapLoginModule entry for Active Directory in the core.xml file used to get the groups to which a user belongs. By use of groups in this fashion, you can control which permissions a user has (see following examples). In this case, 'admin' is the user that performs the initial connection to the server, and admin password is provided for that purpose. This is a means of granting permissions to Viewpoint users based on what groups they are members of.

<login-module class="com.cri.security.server.modules.LdapLoginModule" flag="required" >
    <option name="initialContextFactory">com.sun.jndi.ldap.LdapCtxFactory</option>
    <option name="connectionURL">ldap://192.168.3.158:389</option>
    <option name="connectionUsername">cn=admin,cn=Users,dc=sge,dc=local</option>
    <option name="connectionPassword">admin_password</option>
    <option name="authentication">simple</option>
    <option name="userBase">cn=Users,dc=sge,dc=local</option>
    <option name="roleBase">cn=Users,dc=sge,dc=local</option>
    <option name="userSearchMatching">(&amp;amp;(sAMAccountName={0})(objectcategory=user))</option>
    <option name="roleName">cn</option>
    <option name="roleSearchMatching">(member={0})</option>
</login-module>

2.3.3 Request Handler Example

When the LdapLoginModule is used, the following <request-handler> parameters must be set as well:

<request-handler>
    <parameter callback="ProxyUserCallback">username</parameter>
    <parameter callback="NameCallback">username</parameter>
    <parameter callback="PasswordCallback">password</parameter>
</request-handler>

2.3.4 Permissions Map Example

To take advantage of the LdapLoginModule to manage authorizations/permissions, the following must be added to the core.xml file under the <permissions-map> element. The name of the LdapGroupPrincipal is the container where the users are stored on the LDAP server. Note also that the <role name="user"> element maps directly to the <definition name="user"> element that follows in the Role Definitions section.

<permissions-map>
    <principal type="LdapGroupPrincipal" name="groupA">
        <role name="user" />
    </principal>
    <principal type="LdapGroupPrincipal" name="groupB">
        <role name="admin" /> 
    </principal>
</permissions-map>

2.3.5 Role Definitions

The element <role name="test" /> maps to a given role definition in the <role-definitions> element:

<role-definitions>
    <definition name="test">
	<permission name="random.permission" />
	<permission name="different.permission" />
    </definition>
</role-definitions>