public class HeaderAuthenticationFilter
extends org.springframework.web.filter.GenericFilterBean
| Constructor and Description |
|---|
HeaderAuthenticationFilter(String headerName,
org.springframework.security.authentication.AuthenticationManager authenticationManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected org.springframework.security.core.Authentication |
attemptAuthentication(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain) |
protected org.springframework.security.authentication.AuthenticationManager |
getAuthenticationManager() |
protected String |
getHeaderName() |
protected org.springframework.security.web.util.matcher.RequestMatcher |
getRequiresAuthenticationRequestMatcher() |
protected boolean |
requiresAuthentication(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Indicates whether this filter should attempt to process a login request for the
current invocation.
|
protected boolean |
successfulAuthentication(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain,
org.springframework.security.core.Authentication authResult) |
protected boolean |
unsuccessfulAuthentication(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain,
org.springframework.security.core.AuthenticationException failed)
Clears the
SecurityContextHolder and returns true. |
public HeaderAuthenticationFilter(String headerName, org.springframework.security.authentication.AuthenticationManager authenticationManager)
protected String getHeaderName()
protected org.springframework.security.authentication.AuthenticationManager getAuthenticationManager()
protected org.springframework.security.web.util.matcher.RequestMatcher getRequiresAuthenticationRequestMatcher()
public void afterPropertiesSet()
throws javax.servlet.ServletException
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanafterPropertiesSet in class org.springframework.web.filter.GenericFilterBeanjavax.servlet.ServletExceptionprotected boolean requiresAuthentication(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
It strips any parameters from the "path" section of the request URL (such as the
jsessionid parameter in http://host/myapp/index.html;jsessionid=blah)
before matching against the filterProcessesUrl property.
Subclasses may override for special requirements, such as Tapestry integration.
true if the filter should attempt authentication,
false otherwise.public void doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
throws IOException,
javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionprotected boolean successfulAuthentication(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain,
org.springframework.security.core.Authentication authResult)
throws IOException,
javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionprotected boolean unsuccessfulAuthentication(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain,
org.springframework.security.core.AuthenticationException failed)
throws IOException,
javax.servlet.ServletException
SecurityContextHolder and returns true.IOExceptionjavax.servlet.ServletExceptionprotected org.springframework.security.core.Authentication attemptAuthentication(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws org.springframework.security.core.AuthenticationException,
IOException,
javax.servlet.ServletException
org.springframework.security.core.AuthenticationExceptionIOExceptionjavax.servlet.ServletExceptionCopyright © 2017. All rights reserved.