edu.yale.its.tp.cas.client.filter
Class CASFilter

java.lang.Object
  extended by edu.yale.its.tp.cas.client.filter.CASFilter
All Implemented Interfaces:
javax.servlet.Filter

public class CASFilter
extends java.lang.Object
implements javax.servlet.Filter

Protects web-accessible resources with CAS.

The following filter initialization parameters are declared in web.xml:

The logged-in username is set in the session attribute defined by the value of CAS_FILTER_USER and may be accessed from within your application either by setting wrapRequest and calling request.getRemoteUser(), or by calling session.getAttribute(CASFilter.CAS_FILTER_USER).

Author:
Shawn Bayern

Field Summary
static java.lang.String CAS_FILTER_USER
          Session attribute in which the username is stored
 
Constructor Summary
CASFilter()
           
 
Method Summary
 void destroy()
           
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain fc)
           
 void init(javax.servlet.FilterConfig config)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CAS_FILTER_USER

public static final java.lang.String CAS_FILTER_USER
Session attribute in which the username is stored

See Also:
Constant Field Values
Constructor Detail

CASFilter

public CASFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig config)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Filter
Throws:
javax.servlet.ServletException

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain fc)
              throws javax.servlet.ServletException,
                     java.io.IOException
Specified by:
doFilter in interface javax.servlet.Filter
Throws:
javax.servlet.ServletException
java.io.IOException

destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Filter