org.jasig.cas.client.util
Class HttpServletRequestWrapperFilter
java.lang.Object
org.jasig.cas.client.util.AbstractConfigurationFilter
org.jasig.cas.client.util.HttpServletRequestWrapperFilter
- All Implemented Interfaces:
- javax.servlet.Filter
public final class HttpServletRequestWrapperFilter
- extends AbstractConfigurationFilter
Implementation of a filter that wraps the normal HttpServletRequest with a
wrapper that overrides the following methods to provide data from the
CAS Assertion:
HttpServletRequest.getUserPrincipal()
HttpServletRequest.getRemoteUser()
HttpServletRequest.isUserInRole(String)
This filter needs to be configured in the chain so that it executes after
both the authentication and the validation filters.
- Since:
- 3.0
- Version:
- $Revision: 11729 $ $Date: 2007-09-26 14:22:30 -0400 (Tue, 26 Sep 2007) $
- Author:
- Scott Battaglia, Marvin S. Addison
|
Method Summary |
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain filterChain)
Wraps the HttpServletRequest in a wrapper class that delegates
request.getRemoteUser to the underlying Assertion object
stored in the user session. |
void |
init(javax.servlet.FilterConfig filterConfig)
|
protected AttributePrincipal |
retrievePrincipalFromSessionOrRequest(javax.servlet.ServletRequest servletRequest)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HttpServletRequestWrapperFilter
public HttpServletRequestWrapperFilter()
destroy
public void destroy()
doFilter
public void doFilter(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain filterChain)
throws java.io.IOException,
javax.servlet.ServletException
- Wraps the HttpServletRequest in a wrapper class that delegates
request.getRemoteUser to the underlying Assertion object
stored in the user session.
- Throws:
java.io.IOException
javax.servlet.ServletException
retrievePrincipalFromSessionOrRequest
protected AttributePrincipal retrievePrincipalFromSessionOrRequest(javax.servlet.ServletRequest servletRequest)
init
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
Copyright © 2006-2009 JA-SIG. All Rights Reserved.