Class OAuth2TokenEndpointFilter

java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
org.springframework.security.oauth2.server.authorization.web.OAuth2TokenEndpointFilter
All Implemented Interfaces:
jakarta.servlet.Filter, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.EnvironmentAware, org.springframework.core.env.EnvironmentCapable, org.springframework.web.context.ServletContextAware

public final class OAuth2TokenEndpointFilter extends org.springframework.web.filter.OncePerRequestFilter
A Filter for the OAuth 2.0 Token endpoint, which handles the processing of an OAuth 2.0 Authorization Grant.

It converts the OAuth 2.0 Authorization Grant request to an Authentication, which is then authenticated by the AuthenticationManager. If the authentication succeeds, the AuthenticationManager returns an OAuth2AccessTokenAuthenticationToken, which is returned in the OAuth 2.0 Access Token response. In case of any error, an OAuth2Error is returned in the OAuth 2.0 Error response.

By default, this Filter responds to authorization grant requests at the URI /oauth2/token and HttpMethod POST.

The default endpoint URI /oauth2/token may be overridden via the constructor OAuth2TokenEndpointFilter(AuthenticationManager, String).

Since:
7.0
See Also: