As of JASIG CAS Client for Java 3.1.3, the distribution will include Confluence support. Confluence support is enabled by a custom CAS authenticator that extends the ConfluenceAuthenticator included with Confluence.
Modifying the web.xml
File is located in $CONFLUENCE_HOME/confluence/WEB-INF/web.xml
To enable the confluence authentication, the first thing that needs to be done is to modify the web.xml to include the CAS validation filter.
First, add the actual filter mapping to your list of filters. It needs to go before the mapping for "login".
<filter-mapping> <filter-name>CasValidationFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
Next, add the actual definition, which has the parameters:
<filter> <filter-name>CasValidationFilter</filter-name> <filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class> <init-param> <param-name>casServerUrlPrefix</param-name> <param-value>https://www.ja-sig.org/cas</param-value> </init-param> <init-param> <param-name>serverName</param-name> <param-value>http://localhost:8080</param-value> </init-param> <init-param> <param-name>redirectAfterValidation</param-name> <param-value>true</param-value> </init-param> </filter>
Replace the casServerUrlPrefix and the serverName with your own local configuration.
Modifying the seraph-config.xml
File is located in $CONFLUENCE_HOME/confluence/WEB-INF/classes/seraph-config.xml
Locate the "authenticator" element and replace it with the following:
<authenticator class="org.jasig.cas.client.integration.atlassian.ConfluenceCasAuthenticator"/>
Next, change the login.url and link.login.url from this:
<init-param> <param-name>login.url</param-name> <param-value>/login.action?os_destination=${originalurl}</param-value> </init-param> <init-param> <param-name>link.login.url</param-name> <param-value>/login.action</param-value> </init-param>
To this:
<init-param> <param-name>login.url</param-name> <param-value>https://localhost:8443/cas/login?service=${originalurl}</param-value> </init-param> <init-param> <param-name>link.login.url</param-name> <param-value>https://localhost:8443/cas/login?service=http://yourwikiurl.edu/</param-value> </init-param>
Be sure change localhost and yourwikiurl.edu to match your environment.
Jars
The following jars should be placed in $CONFLUENCE_HOME/confluence/WEB-INF/lib/
Copy in the cas-client-core and the cas-client-integration-atlassian jars.
