Scenes Supported
OFBiz-CAS-LDAP component supports the following scenes: OFBiz-CAS-OpenLDAP, OFBiz-CAS-ActiveDirectory, OFBiz-OpenLDAP and OFBiz-ActiveDirectory.
OFBiz-CAS-LDAP Login Procedure
The new OFBiz login procedure as following:
OFBiz-CAS Logout Procedure
The new OFBiz logout procedure as following:
Deploy OFBiz-CAS-LDAP Component in OFBiz 4.0
Here are the steps on deploying OFBiz-CAS-LDAP Component in OFBiz 4.0:
- Use Eclipse SVN plugin download OFBiz-LDAP component from http://www.langhua.cn/langhua/ofbiz-components/OFBiz-LDAP/branch/ofbiz4.0-cas3.2.1.1-openldap2.4.8/ as a new Java project(SVN username: anon, password: anon).
- Edit build.xml of the new project, change ofbiz.home property to the path where your OFBiz is.
- Run ofbiz.copy of build.xml, OFBiz-LDAP component will be deployed to $(ofbiz.home)/specialpurpose/ldap/.
- Edit $(ofbiz.home)/specialpurpose/build.xml, add ldap/build.xml:
- Edit $(ofbiz.home)/specialpurpose/component-load.xml, add:
- If nessecery, change getPartyId and getSecurityGroup in /cn/langhua/ofbiz/ldap/commons/A_OFBizAuthenticationHandler.java.
- Run build of $(ofbiz.home)/build.xml.
- If CAS is deployed in tomcat in the same computer with OFBiz, change tomcat's ssl port to another value such as 8444 and restart tomcat.
- Edit the configurations in $(ofbiz.home)/specialpurpose/ldap/config/ldap.xml, see Configuration for details.
- Change checkLogin, login and logout in every WEB-INF/controller.xml:
- Run OFBiz. Try to login OFBiz, you'll be redirect to CAS login page. Input a correct username and password, you'll be able to login OFBiz.
- Click Logout in OFBiz, you'll be redirect to CAS logout page.
Configuration
The component can be configed by $(ofbiz.home)/specialpurpose/ldap/config/ldap.xml. Here is a sample of its content:
Currently, there are 3 AuthenticationHandlers:
- cn.langhua.ofbiz.ldap.cas.OFBizCasAuthenticationHandler: CAS authentication handler.
- cn.langhua.ofbiz.ldap.openldap.OFBizLdapAuthenticationHandler: OpenLDAP authentication handler.
- cn.langhua.ofbiz.ldap.activedirectory.OFBizActiveDirectoryAuthenticationHandler: Active Directory authentication handler.
Enjoy it.
原文:https://wiki.jasig.org/display/CASC/CASifying+Apache+OFBiz