org.acegisecurity.adapters.cas
Class CasPasswordHandlerProxy

java.lang.Object
  extended by org.acegisecurity.adapters.cas.CasPasswordHandlerProxy
All Implemented Interfaces:
edu.yale.its.tp.cas.auth.AuthHandler, edu.yale.its.tp.cas.auth.PasswordHandler

public class CasPasswordHandlerProxy
extends Object
implements edu.yale.its.tp.cas.auth.PasswordHandler

Enables CAS to use the Acegi Security System for authentication.

This class works along with CasPasswordHandler to enable users to easily migrate from stand-alone Acegi Security System deployments to enterprise-wide CAS deployments.

It should be noted that the Acegi Security System will operate as a CAS client irrespective of the PasswordHandler used on the CAS server. In other words, this class need not be used on the CAS server if not desired. It exists solely for the convenience of users wishing have CAS delegate to an Acegi Security System-based AuthenticationManager.

This class works requires a properly configured CasPasswordHandler. On the first authentication request, the class will use Spring's WebApplicationContextUtils.getWebApplicationContext(ServletContext sc) method to obtain an ApplicationContext instance, inside which must be a configured CasPasswordHandler instance. The CasPasswordHandlerProxy will then delegate authentication requests to that instance.

To configure CAS to use this class, edit CAS' web.xml and define the edu.yale.its.tp.cas.authHandler context parameter with the value org.acegisecurity.adapters.cas.CasPasswordHandlerProxy.

Version:
$Id: CasPasswordHandlerProxy.java,v 1.2 2005/11/17 00:56:28 benalex Exp $
Author:
Ben Alex

Constructor Summary
CasPasswordHandlerProxy()
           
 
Method Summary
 boolean authenticate(javax.servlet.ServletRequest request, String username, String password)
          Called by CAS when authentication is required.
protected  ApplicationContext getContext(javax.servlet.http.HttpServletRequest httpRequest)
          Allows test cases to override where application context obtained from.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CasPasswordHandlerProxy

public CasPasswordHandlerProxy()
Method Detail

authenticate

public boolean authenticate(javax.servlet.ServletRequest request,
                            String username,
                            String password)
Called by CAS when authentication is required.

Delegates to the CasPasswordHandler.

Specified by:
authenticate in interface edu.yale.its.tp.cas.auth.PasswordHandler
Parameters:
request - as provided by CAS
username - provided to CAS
password - provided to CAS
Returns:
whether authentication was successful or not
Throws:
IllegalArgumentException - if the application context does not contain a CasPasswordHandler or the ServletRequest was not of type HttpServletRequest

getContext

protected ApplicationContext getContext(javax.servlet.http.HttpServletRequest httpRequest)
Allows test cases to override where application context obtained from.

Parameters:
httpRequest - which can be used to find the ServletContext
Returns:
the Spring application context


Copyright © 2004-2005 Acegi Technology Pty Limited. All Rights Reserved.