public final class OAuth2ClientAuthenticationFilter
extends org.springframework.web.filter.OncePerRequestFilter
Filter that processes an authentication request for an OAuth 2.0 Client.AuthenticationManager,
JwtClientAssertionAuthenticationConverter,
JwtClientAssertionAuthenticationProvider,
ClientSecretBasicAuthenticationConverter,
ClientSecretPostAuthenticationConverter,
ClientSecretAuthenticationProvider,
PublicClientAuthenticationConverter,
PublicClientAuthenticationProvider,
Section 2.3 Client Authentication,
Section 3.2.1 Token Endpoint Client Authentication| Constructor and Description |
|---|
OAuth2ClientAuthenticationFilter(org.springframework.security.authentication.AuthenticationManager authenticationManager,
org.springframework.security.web.util.matcher.RequestMatcher requestMatcher)
Constructs an
OAuth2ClientAuthenticationFilter using the provided parameters. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doFilterInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain filterChain) |
void |
setAuthenticationConverter(org.springframework.security.web.authentication.AuthenticationConverter authenticationConverter)
Sets the
AuthenticationConverter used when attempting to extract client credentials from HttpServletRequest
to an instance of OAuth2ClientAuthenticationToken used for authenticating the client. |
void |
setAuthenticationFailureHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler authenticationFailureHandler)
Sets the
AuthenticationFailureHandler used for handling a failed client authentication
and returning the Error Response. |
void |
setAuthenticationSuccessHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler authenticationSuccessHandler)
Sets the
AuthenticationSuccessHandler used for handling a successful client authentication
and associating the OAuth2ClientAuthenticationToken to the SecurityContext. |
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatchpublic OAuth2ClientAuthenticationFilter(org.springframework.security.authentication.AuthenticationManager authenticationManager,
org.springframework.security.web.util.matcher.RequestMatcher requestMatcher)
OAuth2ClientAuthenticationFilter using the provided parameters.authenticationManager - the AuthenticationManager used for authenticating the clientrequestMatcher - the RequestMatcher used for matching against the HttpServletRequestprotected 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.OncePerRequestFilterjavax.servlet.ServletExceptionjava.io.IOExceptionpublic void setAuthenticationConverter(org.springframework.security.web.authentication.AuthenticationConverter authenticationConverter)
AuthenticationConverter used when attempting to extract client credentials from HttpServletRequest
to an instance of OAuth2ClientAuthenticationToken used for authenticating the client.authenticationConverter - the AuthenticationConverter used when attempting to extract client credentials from HttpServletRequestpublic void setAuthenticationSuccessHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler authenticationSuccessHandler)
AuthenticationSuccessHandler used for handling a successful client authentication
and associating the OAuth2ClientAuthenticationToken to the SecurityContext.authenticationSuccessHandler - the AuthenticationSuccessHandler used for handling a successful client authenticationpublic void setAuthenticationFailureHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler authenticationFailureHandler)
AuthenticationFailureHandler used for handling a failed client authentication
and returning the Error Response.authenticationFailureHandler - the AuthenticationFailureHandler used for handling a failed client authentication