Hi List, OFBiz-OpenOCES component is to add an implement instance of certificate logon (not use SSL certificate) and digital signature functions to OFBiz.
OFBiz-OpenOCES is in LGPL licience. You can get the source code from Langhua's svn: http://www.langhua.cn/langhua/ofbiz-components/OFBiz-OpenOCES/ Username/password is anon/anon. Or check the code in viewvc: http://www.langhua.cn/viewvc/ofbiz-components/OFBiz-OpenOCES/ More information on OFBiz, please visit http://ofbiz.apache.org/. More information on OpenOCES, please visit http://www.openoces.org/. More information on Langhua, please visit http://www.langhua.cn/en/. Here are the steps of how to OFBiz-OpenOCES component. 1. Deploy OFBiz-OpenOCES component 1.1 In Eclipse, use svn to create a project and download source code from http://www.langhua.cn/langhua/ofbiz-components/OFBiz-OpenOCES/ Username/password is anon/anon. 1.2 Edit build.xml, change the deploy directory in target "ofbiz.copy". 1.3 Run "ofbiz.copy". The files of OFBiz-OpenOCES component will be deployed to $OFBIZ_HOME/specialpurpose/openoces/. 1.4 Edit specialpurpose/component-load.xml, add <load-component component-location="${ofbiz.home}/specialpurpose/openoces"/> 2. Configurations 2.1 OpenLogon Configurations 2.1.1 Edit */webapp/WEB-INF/web.xml, add the following: <servlet> <servlet-name>OpenLogonVerifier</servlet-name> <servlet-class>cn.langhua.ofbiz.openlogon.OFBizOpenLogonVerifier</servlet-class> </servlet> <servlet-mapping> <servlet-name>OpenLogonVerifier</servlet-name> <url-pattern>/openlogon/verifier</url-pattern> </servlet-mapping> <servlet> <servlet-name>OpenLogonDisplay</servlet-name> <servlet-class>cn.langhua.ofbiz.openlogon.OFBizOpenLogonDisplay</servlet-class> </servlet> <servlet-mapping> <servlet-name>OpenLogonDisplay</servlet-name> <url-pattern>/openlogon/display</url-pattern> </servlet-mapping> and add /openlogon to allowedPaths: <init-param> <param-name>allowedPaths</param-name> <param-value>/control:/select:/index.html:/index.jsp:/default.html:/default.jsp:/images:/includes/maincss.css:/openlogon</param-value> </init-param> 2.1.2 Edit */webapp/WEB-INF/controller.xml, change <event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="checkLogin" /> to <event type="java" path="cn.langhua.ofbiz.openlogon.OFBizOpenLogon" invoke="checkLogin" /> change <event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="login"/> to <event type="java" path="cn.langhua.ofbiz.openlogon.OFBizOpenLogon" invoke="login"/> 2.1.3 Modify framework/common/webcommon/login.ftl to the following: <#assign logonApplet = Static["cn.langhua.ofbiz.openlogon.OFBizOpenLogonApplet"].createAppletCode(request, response, "specialpurpose/openoces/config/openlogon.xml", "challenge=mychallenge")> <div class="screenlet login-screenlet"> <div class="screenlet-title-bar"> <h3>${uiLabelMap.CommonRegistered}</h3> </div> <div class="screenlet-body"> <table cellspacing="0"> <tr> <td align="center">${logonApplet}</td> </tr> </table> </div> </div> 2.1.4 Config specialpurpose/openoces/config/openlogon.xml if you want a different style. 2.1.5 Run "build" of OFBiz build.xml. 2.2 OpenSign Configurations 2.2.1 Edit */webapp/WEB-INF/web.xml, add the following: <servlet> <servlet-name>OpenSignVerifier</servlet-name> <servlet-class>cn.langhua.ofbiz.opensign.OFBizOpenSignVerifier</servlet-class> </servlet> <servlet-mapping> <servlet-name>OpenSignVerifier</servlet-name> <url-pattern>/opensign/verifier</url-pattern> </servlet-mapping> <servlet> <servlet-name>OpenSignDisplay</servlet-name> <servlet-class>cn.langhua.ofbiz.opensign.OFBizOpenSignDisplay</servlet-class> </servlet> <servlet-mapping> <servlet-name>OpenSignDisplay</servlet-name> <url-pattern>/opensign/display</url-pattern> </servlet-mapping> and add /opensign to allowedPaths: <init-param> <param-name>allowedPaths</param-name> <param-value>/control:/select:/index.html:/index.jsp:/default.html:/default.jsp:/images:/includes/maincss.css:/opensign</param-value> </init-param> 2.2.2 Config specialpurpose/openoces/config/opensign.xml if you want a different style. 2.2.3 Run "build" of OFBiz build.xml. 3. Usage 3.1 OpenLogon If you run OFBiz in your local system, in web browser, visit https://localhost:8443/catalog/ you'll see a logon applet similar to openlogon.png(http://www.langhua.cn/viewvc/ofbiz-components/OFBiz-OpenOCES/trunk/docs/openlogon.png?view=markup) shown. Tips: If you use Linux/Unix, you can put your certificate in ~/.oces/, then your certificate will be displayed in the select box. If you use MS Windows, your certificate in IE will be automatically filled in the select box. If you want to use this component in a production system, please make sure you have changed the implements of parseSecurityGroupId(X509Certificate cert) and partyIdParser(X509Certificate cert) in cn.langhua.ofbiz.openlogon.OFBizOpenLogon.java 3.2 OpenSign You have to make some further customizations to store the digital signatures. 4. Feedback If you find any bugs or you have any suggestion on this component, please send a email to [EMAIL PROTECTED] 5. Thanks Thanks Commercial Cryptogram Research Center of China who sponsored this component. Have a nice weekend, Shi Yusen/Beijing Langhua Ltd.