Introduction: This document describes the steps of authenticating Helical Insight application using Lightweight Directory Access Protocol (LDAP).
Prerequisite :
- Java version 1.7 or higher
- Helical Insight Application Version 2.0 +
Download the files required for integration of LDAP with Helical Insight application from below link.
Download the files from here
Below are the steps :
- Configurations needs to do on LDAP client and server :
- Download and install OpenLDAP server and OpenLDAP client. Once installation is done add some users and it’s related information to OpenLDAP. For reference you can use the below links :
- http://www.userbooster.de/en/support/feature-articles/openldap-for-windows-installation.aspx
- kukusan-network-blogspot-in-2012-01-how-to-setting-ldap-openldap-in-windows.html
- https://www.howtoforge.com/linux_openldap_setup_server_client
- Configurations for Helical Insight application server :
- Download and add JAR files in lib folder ( lib folder is located at “WEB-INF/lib/”), in order to add the spring and spring-security related dependencies for LDAP.
Below is the list of JAR files which needs to be download and add inside lib folder.
1. spring-security-ldap-3.1.3.RELEASE.jar
2. spring-ldap-core-1.3.0.RELEASE.jar
- Create “externalauth” folder inside “WEB-INF/classes/com/helicalinsight” folder.
- Create “ldap” folder inside “WEB-INF/classes/com/helicalinsight/externalauth” folder.
- Add any one of the “HiLdapAuthentication.class” file (either with default role as ROLE_USER or with default role as ROLE_ADMIN) provided in the zip package (LDAP Integration Files) with this blog inside “WEB-INF/classes/com/helicalinsight/externalauth/ldap” folder.
- Open “spring-security.xml” file in a text editor. ( “spring-security.xml” file will be located at “WEB-INF/classes/” folder).
- Add the reference of “authentication-provider” for LDAP in “authentication-manager” tags of “spring-security.xml” file as shown below:
<authentication-manager alias="authenticationManager" erase-credentials="false">
<authentication-provider user-service-ref="userDetailsService"/>
<authentication-provider ref="casAuthenticationProvider"/>
<authentication-provider ref="internalAuthenticationProvider"/>
<authentication-provider ref="ldapAuthProvider" />
</authentication-manager>
- Add the properties and configurations of LDAP in “spring-security.xml” file as shown below:
Note : Configure the server details, userDn, password as per your own server details.
<beans:bean id="contextSource" class="org.springframework.security.ldap.DefaultSpringSecurityContextSource"> <beans:constructor-arg value="ldap://192.168.2.82:389/dc=maxcrc,dc=com"/> <beans:property name="userDn" value="cn=Manager,dc=maxcrc,dc=com"/> <beans:property name="password" value="secret"/> </beans:bean> <beans:bean id="ldapAuthProvider" class="com.helicalinsight.externalauth.ldap.HiLdapAuthentication"> <beans:constructor-arg> <beans:bean class="org.springframework.security.ldap.authentication.BindAuthenticator"> <beans:constructor-arg ref="contextSource"/> <beans:property name="userDnPatterns"> <beans:list><beans:value>uid={0},ou=people</beans:value></beans:list> </beans:property> </beans:bean> </beans:constructor-arg> <beans:constructor-arg> <beans:bean class="org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator"> <beans:constructor-arg ref="contextSource"/> <beans:constructor-arg value="ou=people"/> <beans:property name="groupRoleAttribute" value="ou"/> </beans:bean> </beans:constructor-arg> </beans:bean>
- Once this configurations are done, save the “spring-security.xml” file and close it.
- Restart the Helical Insight application server.
- Once application is restarted, try to access the application using application url.
Example : “http://localhost:8085/hi-ee/”
- Now provide the credentials to login into the application.
- Keep the Organization Name field as blank.
- Provide uid (of LDAP user) in Username field of HI application.
- Provide the userpassword (of LDAP user) in Password field of HI application.
Note : This will create the session for LDAP user inside Helical Insight application with default role as “ROLE_ADMIN” or “ROLE_USER” (based on the class file which you have used) and default organization as “null”. We can enhance this process to modify and sync roles, profiles, organization details according to requirement.