public class AlaHttpServletRequestWrapperFilter
extends org.jasig.cas.client.util.AbstractConfigurationFilter
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.
This code has been shamelessly copied from HttpServletRequestWrapperFilter
since that class is final and cannot be extended.
Only the isUserInRole() needed to
be overridden to accommodate a csv list of roles in the returned user attributes. This wrapper also supports
a list of roles.
| Constructor and Description |
|---|
AlaHttpServletRequestWrapperFilter() |
| Modifier and Type | Method and Description |
|---|---|
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 org.jasig.cas.client.authentication.AttributePrincipal |
retrievePrincipalFromSessionOrRequest(javax.servlet.ServletRequest servletRequest) |
public void destroy()
public void doFilter(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain filterChain)
throws IOException,
javax.servlet.ServletException
request.getRemoteUser to the underlying Assertion object
stored in the user session.IOExceptionjavax.servlet.ServletExceptionprotected org.jasig.cas.client.authentication.AttributePrincipal retrievePrincipalFromSessionOrRequest(javax.servlet.ServletRequest servletRequest)
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
init in interface javax.servlet.Filterinit in class org.jasig.cas.client.util.AbstractConfigurationFilterjavax.servlet.ServletExceptionCopyright © 2017. All rights reserved.