public final class BearerTokenAuthenticationFilter
extends org.springframework.web.filter.OncePerRequestFilter
AuthenticationManager that can authenticate
a BearerTokenAuthenticationToken.JwtAuthenticationProvider| Constructor and Description |
|---|
BearerTokenAuthenticationFilter(org.springframework.security.authentication.AuthenticationManager authenticationManager)
Construct a
BearerTokenAuthenticationFilter using the provided parameter(s) |
BearerTokenAuthenticationFilter(org.springframework.security.authentication.AuthenticationManagerResolver<javax.servlet.http.HttpServletRequest> authenticationManagerResolver)
Construct a
BearerTokenAuthenticationFilter using the provided parameter(s) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doFilterInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain filterChain)
Extract any
Bearer
Token from the request and attempt an authentication.
|
void |
setAuthenticationEntryPoint(org.springframework.security.web.AuthenticationEntryPoint authenticationEntryPoint)
Set the
AuthenticationEntryPoint to use. |
void |
setAuthenticationFailureHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler authenticationFailureHandler)
Set the
AuthenticationFailureHandler to use. |
void |
setBearerTokenResolver(BearerTokenResolver bearerTokenResolver)
Set the
BearerTokenResolver to use. |
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatchpublic BearerTokenAuthenticationFilter(org.springframework.security.authentication.AuthenticationManagerResolver<javax.servlet.http.HttpServletRequest> authenticationManagerResolver)
BearerTokenAuthenticationFilter using the provided parameter(s)authenticationManagerResolver - public BearerTokenAuthenticationFilter(org.springframework.security.authentication.AuthenticationManager authenticationManager)
BearerTokenAuthenticationFilter using the provided parameter(s)authenticationManager - protected void doFilterInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain filterChain)
throws javax.servlet.ServletException,
java.io.IOException
doFilterInternal in class org.springframework.web.filter.OncePerRequestFilterrequest - response - filterChain - javax.servlet.ServletExceptionjava.io.IOExceptionpublic void setBearerTokenResolver(BearerTokenResolver bearerTokenResolver)
BearerTokenResolver to use. Defaults to
DefaultBearerTokenResolver.bearerTokenResolver - the BearerTokenResolver to usepublic void setAuthenticationEntryPoint(org.springframework.security.web.AuthenticationEntryPoint authenticationEntryPoint)
AuthenticationEntryPoint to use. Defaults to
BearerTokenAuthenticationEntryPoint.authenticationEntryPoint - the AuthenticationEntryPoint to usepublic void setAuthenticationFailureHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler authenticationFailureHandler)
AuthenticationFailureHandler to use. Default implementation invokes
AuthenticationEntryPoint.authenticationFailureHandler - the AuthenticationFailureHandler to use