Dashboard > CAS User Manual > Home > Authentication > Legacy
Log In   View a printable version of the current page.
Added by Scott Battaglia , last edited by Scott Battaglia on Mar 04, 2007  (view change)
Labels: 
(None)


Legacy Authentication Handler

Please note that though we support adapting CAS2 PasswordHandlers to CAS3 Authentication Handlers we recommend you upgrade to an Authentication Handler (especially since we have many generic solutions).

Including the Handler

In the pom.xml file for your CAS webapp (the default is ${project.home}/cas-server-webapp/pom.xml) add the following dependency:

<dependency>
     <groupId>${project.groupId}</groupId>
     <artifactId>cas-server-support-legacy</artifactId>
     <version>${project.version}</version>
</dependency>

Core Classes

LegacyCasCredentials

This class is an extension of the traditional CAS3 UsernamePasswordCredentials to include the HttpServletRequest, which all CAS2 password handler classes expect.

LegacyCasCredentialsBinder

The legacy binder allows for additional binding beyond the normal Spring request parameter/property binding. In this case it sets the request property on the LegacyCasCredentials.

LegacyCasPasswordHandlerAdaptorAuthenticationHandler

This class basically extracts the properties from the LegacyCasCredentials and passes them to the PasswordHandler.

Configuration

In your cas-servlet.xml, look for the <literal>AuthenticationViaForm</literal> bean, generally defined as follows:

<bean
	id="authenticationViaFormAction"
	parent="abstractCasLoginAction"
	class="org.jasig.cas.web.flow.AuthenticationViaFormAction" />

Modify it so that it looks like this:

<bean id="authenticationViaFormAction" parent="abstractCasLoginAction" class="org.jasig.cas.web.flow.AuthenticationViaFormAction">
	<property name="formObjectClass" value="org.jasig.cas.adaptors.cas.LegacyCasCredentials" />
	<property name="formObjectName" value="credentials" />
	<property name="credentialsBinder">
		<bean
			class="org.jasig.cas.adaptors.cas.LegacyCasCredentialsBinder" />
	</property>
</bean>

This configuration tells the FormAction to use the LegacyCasCredentials and the LegacyCasCredentialsBinder.

Finally, in your deployerConfigContext.xml, you'll need to define your password handler. In most cases you'll want to replace the existing test handler definition with the following:

<bean class="org.jasig.cas.adaptors.cas.LegacyPasswordHandlerAdaptorAuthenticationHandler">
	<property name="passwordHandler">
	  <bean class="edu.someschoool.its.cas.MySpecialPasswordHandler"/>
	</property>
</bean>

Note that edu.someschoool.its.cas.MySpecialPasswordHandler should be replaced with your PasswordHandler class name.

Powered by a free Atlassian Confluence Open Source Project License granted to Java Architectures Special Interest Group. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7.3, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators