public final class OAuth2AuthorizationEndpointFilter
extends org.springframework.web.filter.OncePerRequestFilter
Filter for the OAuth 2.0 Authorization Code Grant,
which handles the processing of the OAuth 2.0 Authorization Request (and Consent).AuthenticationManager,
OAuth2AuthorizationCodeRequestAuthenticationProvider,
Section 4.1 Authorization Code Grant,
Section 4.1.1 Authorization Request,
Section 4.1.2 Authorization Response| Constructor and Description |
|---|
OAuth2AuthorizationEndpointFilter(org.springframework.security.authentication.AuthenticationManager authenticationManager)
Constructs an
OAuth2AuthorizationEndpointFilter using the provided parameters. |
OAuth2AuthorizationEndpointFilter(org.springframework.security.authentication.AuthenticationManager authenticationManager,
java.lang.String authorizationEndpointUri)
Constructs an
OAuth2AuthorizationEndpointFilter 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 an Authorization Request (or Consent) from HttpServletRequest
to an instance of OAuth2AuthorizationCodeRequestAuthenticationToken used for authenticating the request. |
void |
setAuthenticationDetailsSource(org.springframework.security.authentication.AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
Sets the
AuthenticationDetailsSource used for building an authentication details instance from HttpServletRequest. |
void |
setAuthenticationFailureHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler authenticationFailureHandler)
Sets the
AuthenticationFailureHandler used for handling an OAuth2AuthorizationCodeRequestAuthenticationException
and returning the Error Response. |
void |
setAuthenticationSuccessHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler authenticationSuccessHandler)
Sets the
AuthenticationSuccessHandler used for handling an OAuth2AuthorizationCodeRequestAuthenticationToken
and returning the Authorization Response. |
void |
setConsentPage(java.lang.String consentPage)
Specify the URI to redirect Resource Owners to if consent is required.
|
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatchpublic OAuth2AuthorizationEndpointFilter(org.springframework.security.authentication.AuthenticationManager authenticationManager)
OAuth2AuthorizationEndpointFilter using the provided parameters.authenticationManager - the authentication managerpublic OAuth2AuthorizationEndpointFilter(org.springframework.security.authentication.AuthenticationManager authenticationManager,
java.lang.String authorizationEndpointUri)
OAuth2AuthorizationEndpointFilter using the provided parameters.authenticationManager - the authentication managerauthorizationEndpointUri - the endpoint URI for authorization requestsprotected 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 setAuthenticationDetailsSource(org.springframework.security.authentication.AuthenticationDetailsSource<javax.servlet.http.HttpServletRequest,?> authenticationDetailsSource)
AuthenticationDetailsSource used for building an authentication details instance from HttpServletRequest.authenticationDetailsSource - the AuthenticationDetailsSource used for building an authentication details instance from HttpServletRequestpublic void setAuthenticationConverter(org.springframework.security.web.authentication.AuthenticationConverter authenticationConverter)
AuthenticationConverter used when attempting to extract an Authorization Request (or Consent) from HttpServletRequest
to an instance of OAuth2AuthorizationCodeRequestAuthenticationToken used for authenticating the request.authenticationConverter - the AuthenticationConverter used when attempting to extract an Authorization Request (or Consent) from HttpServletRequestpublic void setAuthenticationSuccessHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler authenticationSuccessHandler)
AuthenticationSuccessHandler used for handling an OAuth2AuthorizationCodeRequestAuthenticationToken
and returning the Authorization Response.authenticationSuccessHandler - the AuthenticationSuccessHandler used for handling an OAuth2AuthorizationCodeRequestAuthenticationTokenpublic void setAuthenticationFailureHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler authenticationFailureHandler)
AuthenticationFailureHandler used for handling an OAuth2AuthorizationCodeRequestAuthenticationException
and returning the Error Response.authenticationFailureHandler - the AuthenticationFailureHandler used for handling an OAuth2AuthorizationCodeRequestAuthenticationExceptionpublic void setConsentPage(java.lang.String consentPage)
consentPage - the URI of the custom consent page to redirect to if consent is required (e.g. "/oauth2/consent")