Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

Tip
titleStep 1

Set the formObjectClass property of the LogonFormAction instance in cas-servlet.xml .

Code Block
xmlxml
titleConfiguring LogonFormAction instance in cas-servlet.xml
xml
<bean
    id="loginFormAction"
    class="org.jasig.cas.web.flow.LoginFormAction">
    <property
        name="centralAuthenticationService"
        ref="centralAuthenticationService" />
        <!-- 
         | we add this property definition, which instructs Spring to
         | call setFormObjectClass() on the LoginFormAction instance we're configuring,
         | configuring it to use LegacyCasCredentials as the form class.
         +-->
        <property name="formObjectClass"
            value="org.jasig.cas.adaptors.cas.LegacyCasCredentials" />

</bean>

...

Tip
titleStep 2

Set LegacyCasCredentialsBinder as the credentialsBinder property of the LogonFormAction instance in cas-servlet.xml .

xml
Code Block
xml
titleConfiguring LogonFormAction instance in cas-servlet.xml
xml
<bean
    id="loginFormAction"
    class="org.jasig.cas.web.flow.LoginFormAction">
    <property
        name="centralAuthenticationService"
        ref="centralAuthenticationService" />
        <property name="formObjectClass"
            value="org.jasig.cas.adaptors.cas.LegacyCasCredentials" />

        <!--
         | Now we're setting the credentialsBinder JavaBean property of the LogonFormAction instance.
         | Here we're instructing Spring to call setCredentialsBinder() on the LogonFormAction instance,
         | feeding this property an instance of LegacyCasCredentialsBinder.
         |-->
        <property name="credentialsBinder">
           <bean class="org.jasig.cas.adaptors.cas.LegacyCasCredentialsBinder"/>
        </property>
</bean>

...

In CAS2, you declared the fully qualified name of your implementation of PasswordHandler in web.xml. Suppose your implementation was edu.someschoool.its.cas.MySpecialPasswordHandler . Then your web.xml included:

xml
Code Block
xml
titleDeclaring the PasswordHandler in CAS 2 web.xml
xml
<context-param>
  <param-name>edu.yale.its.tp.cas.authHandler</param-name>
  <param-value>edu.someschoool.its.cas.MySpecialPasswordHandler</param-value>
</context-param>

...

Tip
titleStep 3

Configure the AuthenticationManager to use a LegacyPasswordHandlerAdaptorAuthenticationManager configured to use your PasswordHandler.

xml
Code Block
xml
titleDeclaring the PasswordHandler in CAS3 deployerConfigContext.xml
xml
<bean id="authenticationManager"
    class="org.jasig.cas.authentication.AuthenticationManagerImpl">
    <property name="credentialsToPrincipalResolvers">
        <list>
            <bean
                class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver" />
            <bean
                class="org.jasig.cas.authentication.principal.HttpBasedServiceCredentialsToPrincipalResolver" />
        </list>
   </property>
   <property name="authenticationHandlers">
        <list>
           <bean
                class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler" />
          <!--
           | Here we declare that one of our AuthenticationHandlers is an instance of the CAS 2 PasswordHandler
           | adaptor.
           +-->
          <bean
              class="org.jasig.cas.adaptors.cas.LegacyPasswordHandlerAdaptorAuthenticationHandler">
              <!-- 
               | Here we give the adaptor a PasswordHandler to adapt.
               +-->
              <property name="passwordHandler">
                  <bean
                     class="edu.someschoool.its.cas.MySpecialPasswordHandler"/>
              </property>
          </bean>
	</list>
    </property>
</bean>

...

Declare the credential and the CredentialBinder

xml
Code Block
xml
titleConfiguring LogonFormAction instance in cas-servlet.xml
xml
<bean
    id="loginFormAction"
    class="org.jasig.cas.web.flow.LoginFormAction">
    <property
        name="centralAuthenticationService"
        ref="centralAuthenticationService" />
        <!-- 
         | we add this property definition, which instructs Spring to
         | call setFormObjectClass() on the LogonFormAction instance we're configuring,
         | configuring it to use LegacyCasTrustedCredentials as the form class.
         +-->
        <property name="formObjectClass"
            value="org.jasig.cas.adaptors.cas.LegacyCasTrustedCredentials" />

        <!--
         | Here we're instructing Spring to call setCredentialsBinder() on the LogonFormAction instance,
         | feeding this property an instance of LegacyCasCredentialsBinder.
         | We use the same binder for LegacyCasTrustedCredentials as for LegacyCasCredentials.
         |-->
        <property name="credentialsBinder">
           <bean class="org.jasig.cas.adaptors.cas.LegacyCasCredentialsBinder"/>
        </property>

</bean>

Adapt and declare your TrustHandler

xml
Code Block
xml
titleDeclaring the PasswordHandler in CAS3 deployerConfigContext.xml
xml
<bean id="authenticationManager"
    class="org.jasig.cas.authentication.AuthenticationManagerImpl">
    <property name="credentialsToPrincipalResolvers">
        <list>
            <bean
                class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver" />
            <bean
                class="org.jasig.cas.authentication.principal.HttpBasedServiceCredentialsToPrincipalResolver" />
        </list>
   </property>
   <property name="authenticationHandlers">
        <list>
           <bean
                class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler" />
          <!--
           | Here we declare that one of our AuthenticationHandlers is an instance of the CAS 2 PasswordHandler
           | adaptor.
           +-->
          <bean
              class="org.jasig.cas.adaptors.cas.LegacyTrustHandlerAdaptorAuthenticationHandler">
              <!-- 
               | Here we give the adaptor a TrustHandler to adapt.
               +-->
              <property name="trustHandler">
                  <bean
                     class="edu.someschoool.its.cas.MySpecialTrustHandler"/>
              </property>
          </bean>
	</list>
    </property>
</bean>