info.magnolia.cms.security
Class SecurityCallbackFilter
java.lang.Object
info.magnolia.cms.filters.AbstractMgnlFilter
info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter
info.magnolia.cms.security.SecurityCallbackFilter
- All Implemented Interfaces:
- MgnlFilter, javax.servlet.Filter
public class SecurityCallbackFilter
- extends OncePerRequestAbstractMgnlFilter
A filter which handles 401, 403 HTTP response codes, as well as AccessDeniedException
s,
and renders an appropriate "login form" (which can consist of a redirect or anything else just as well).
A number of HttpClientCallback
s can be configured for this filter, each with a different configuration,
and behavior. The AbstractHttpClientCallback
provides a number
of filtering capabilities (using url, host or voters).
This functionality used to live in BaseSecurityFilter
, URISecurityFilter
, as well as ContentSecurityFilter
.
These filters now merely set an HTTP response code or throw an exception, which is handled here.
- Version:
- $Revision: $ ($Author: $)
- Author:
- gjoseph
Methods inherited from class info.magnolia.cms.filters.AbstractMgnlFilter |
acceptsEncoding, acceptsGzipEncoding, addAndVerifyHeader, addBypass, addMapping, destroy, getBypasses, getDispatching, getMapping, getMappings, getName, headerContains, init, isEnabled, mapsTo, matches, matchesDispatching, setDispatching, setEnabled, setName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SecurityCallbackFilter
public SecurityCallbackFilter()
doFilter
public void doFilter(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse originalResponse,
javax.servlet.FilterChain chain)
throws IOException,
javax.servlet.ServletException
- Specified by:
doFilter
in class AbstractMgnlFilter
- Throws:
IOException
javax.servlet.ServletException
needsCallback
protected boolean needsCallback(SecurityCallbackFilter.StatusSniffingResponseWrapper response)
selectAndHandleCallback
protected void selectAndHandleCallback(javax.servlet.http.HttpServletRequest request,
SecurityCallbackFilter.StatusSniffingResponseWrapper response)
selectClientCallback
protected HttpClientCallback selectClientCallback(javax.servlet.http.HttpServletRequest request)
addClientCallback
public void addClientCallback(HttpClientCallback clientCallback)
getClientCallbacks
public List<HttpClientCallback> getClientCallbacks()
Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.