Difference between revisions of "Central Authentication Service - OpenKM 5.1"
From OpenKM Documentation
Line 102: | Line 102: | ||
</filter-mapping> | </filter-mapping> | ||
<!-- /CAS SSO --> | <!-- /CAS SSO --> | ||
+ | </source> | ||
+ | |||
+ | In server/default/conf/login-config.xml: | ||
+ | |||
+ | <source lang="xml"> | ||
+ | <application-policy name="OpenKMWebDav"> | ||
+ | <authentication> | ||
+ | <login-module code="org.jboss.security.auth.spi.LdapExtLoginModule" flag="required" > | ||
+ | <module-option name="java.naming.provider.url">ldap://dokumentum2.chronossoftware.com:389</module-option> | ||
+ | <module-option name="java.naming.security.authentication">simple</module-option> | ||
+ | <module-option name="baseCtxDN">ou=Users,dc=igyuk,dc=hu</module-option> | ||
+ | <module-option name="baseFilter">(cn={0})</module-option> | ||
+ | <module-option name="rolesCtxDN">ou=Groups,dc= igyuk,dc=hu </module-option> | ||
+ | <module-option name="roleFilter">(uniqueMember={1})</module-option> | ||
+ | <module-option name="roleAttributeID">cn</module-option> | ||
+ | <module-option name="roleNameAttributeID">cn</module-option> | ||
+ | <module-option name="roleAttributeIsDN">true</module-option> | ||
+ | <module-option name="roleRecursion">2</module-option> | ||
+ | <module-option name="searchScope">ONELEVEL_SCOPE</module-option> | ||
+ | <module-option name="allowEmptyPasswords">False</module-option> | ||
+ | <module-option name="defaultRole">UserRole</module-option> | ||
+ | </login-module> | ||
+ | </authentication> | ||
+ | </application-policy> | ||
+ | |||
+ | <application-policy name="OpenKM"> | ||
+ | <authentication> | ||
+ | <login-module code="org.jasig.cas.client.jaas.CasLoginModule" flag="required"> | ||
+ | <module-option name="ticketValidatorClass">org.jasig.cas.client.validation.Saml11TicketValidator</module-option> | ||
+ | <module-option name="casServerUrlPrefix">https://dokumentum2.chronossoftware.com/cas</module-option> | ||
+ | <module-option name="service">https://dokumentum2.chronossoftware.com/OpenKM</module-option> | ||
+ | <module-option name="defaultRoles">UserRole</module-option> | ||
+ | <module-option name="roleAttributeNames">groupMembership</module-option> | ||
+ | <module-option name="principalGroupName">CallerPrincipal</module-option> | ||
+ | <module-option name="roleGroupName">Roles</module-option> | ||
+ | <module-option name="cacheAssertions">true</module-option> | ||
+ | <module-option name="tolerance">20000</module-option> | ||
+ | <module-option name="cacheTimeout">480</module-option> | ||
+ | </login-module> | ||
+ | </authentication> | ||
+ | </application-policy> | ||
</source> | </source> |
Revision as of 17:51, 3 October 2011
The Central Authentication Service (CAS) is a single sign-on protocol for the web. Its purpose is to permit a user to access multiple applications while providing their credentials (such as userid and password) only once. It also allows web applications to authenticate users without gaining access to a user's security credentials, such as a password. The name CAS also refers to a software package that implements this protocol.
Once you have the CAS server up and running it is easy to set SSO in OpenKM. I wanted to keep basic authentication for the WebDav part that is why the filter mapping is complicated. I did the following changes in OpenKM:
In server/default/deploy/OpenKM.war/WEB-INF/web.xml:
<!-- CAS SSO-->
<!-- Facilitates CAS single sign-out -->
<listener>
<listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class>
</listener>
<!-- Following is needed only if CAS single-sign out is desired -->
<filter>
<filter-name>CAS Single Sign Out Filter</filter-name>
<filter-class>org.jasig.cas.client.session.SingleSignOutFilter</filter-class>
</filter>
<!-- Only 2 CAS filters are required for JAAS support -->
<context-param>
<param-name>service</param-name>
<param-value>https://openkm.chronossoftware.com/OpenKM</param-value>
</context-param>
<context-param>
<param-name>casServerLoginUrl</param-name>
<param-value>https://openkm.chronossoftware.com/cas/login</param-value>
</context-param>
<filter>
<filter-name>CASWebAuthenticationFilter</filter-name>
<filter-class>org.jasig.cas.client.jboss.authentication.WebAuthenticationFilter</filter-class>
</filter>
<filter>
<filter-name>CASAuthenticationFilter</filter-name>
<filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
</filter>
<!-- CAS client filter mappings -->
<!-- The order of the following filters is vitally important -->
<filter-mapping>
<filter-name>CAS Single Sign Out Filter</filter-name>
<url-pattern>*.jsp</url-pattern>
<!-- GWT -->
<url-pattern>/frontend/*</url-pattern>
<!-- JSPs -->
<url-pattern>/admin/*</url-pattern>
<url-pattern>/mobile/*</url-pattern>
<url-pattern>/mobile-nt/*</url-pattern>
<!-- Servlets -->
<url-pattern>/RepositoryStartup</url-pattern>
<url-pattern>/TextToSpeech</url-pattern>
<url-pattern>/Test</url-pattern>
<url-pattern>/frontend/*</url-pattern>
<url-pattern>/extension/*</url-pattern>
<!--url-pattern>/*</url-pattern-->
</filter-mapping>
<filter-mapping>
<filter-name>CASWebAuthenticationFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
<!-- GWT -->
<url-pattern>/frontend/*</url-pattern>
<!-- JSPs -->
<url-pattern>/admin/*</url-pattern>
<url-pattern>/mobile/*</url-pattern>
<url-pattern>/mobile-nt/*</url-pattern>
<!-- Servlets -->
<url-pattern>/RepositoryStartup</url-pattern>
<url-pattern>/TextToSpeech</url-pattern>
<url-pattern>/Test</url-pattern>
<url-pattern>/frontend/*</url-pattern>
<url-pattern>/extension/*</url-pattern>
<!--url-pattern>/*</url-pattern-->
</filter-mapping>
<filter-mapping>
<filter-name>CASAuthenticationFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
<!-- GWT -->
<url-pattern>/frontend/*</url-pattern>
<!-- JSPs -->
<url-pattern>/admin/*</url-pattern>
<url-pattern>/mobile/*</url-pattern>
<url-pattern>/mobile-nt/*</url-pattern>
<!-- Servlets -->
<url-pattern>/RepositoryStartup</url-pattern>
<url-pattern>/TextToSpeech</url-pattern>
<url-pattern>/Test</url-pattern>
<url-pattern>/frontend/*</url-pattern>
<url-pattern>/extension/*</url-pattern>
<!--url-pattern>/*</url-pattern-->
</filter-mapping>
<!-- /CAS SSO -->
In server/default/conf/login-config.xml:
<application-policy name="OpenKMWebDav">
<authentication>
<login-module code="org.jboss.security.auth.spi.LdapExtLoginModule" flag="required" >
<module-option name="java.naming.provider.url">ldap://dokumentum2.chronossoftware.com:389</module-option>
<module-option name="java.naming.security.authentication">simple</module-option>
<module-option name="baseCtxDN">ou=Users,dc=igyuk,dc=hu</module-option>
<module-option name="baseFilter">(cn={0})</module-option>
<module-option name="rolesCtxDN">ou=Groups,dc= igyuk,dc=hu </module-option>
<module-option name="roleFilter">(uniqueMember={1})</module-option>
<module-option name="roleAttributeID">cn</module-option>
<module-option name="roleNameAttributeID">cn</module-option>
<module-option name="roleAttributeIsDN">true</module-option>
<module-option name="roleRecursion">2</module-option>
<module-option name="searchScope">ONELEVEL_SCOPE</module-option>
<module-option name="allowEmptyPasswords">False</module-option>
<module-option name="defaultRole">UserRole</module-option>
</login-module>
</authentication>
</application-policy>
<application-policy name="OpenKM">
<authentication>
<login-module code="org.jasig.cas.client.jaas.CasLoginModule" flag="required">
<module-option name="ticketValidatorClass">org.jasig.cas.client.validation.Saml11TicketValidator</module-option>
<module-option name="casServerUrlPrefix">https://dokumentum2.chronossoftware.com/cas</module-option>
<module-option name="service">https://dokumentum2.chronossoftware.com/OpenKM</module-option>
<module-option name="defaultRoles">UserRole</module-option>
<module-option name="roleAttributeNames">groupMembership</module-option>
<module-option name="principalGroupName">CallerPrincipal</module-option>
<module-option name="roleGroupName">Roles</module-option>
<module-option name="cacheAssertions">true</module-option>
<module-option name="tolerance">20000</module-option>
<module-option name="cacheTimeout">480</module-option>
</login-module>
</authentication>
</application-policy>