Class OAuth2LoginAuthenticationFilter

java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationFilter
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.ApplicationEventPublisherAware, org.springframework.context.EnvironmentAware, org.springframework.context.MessageSourceAware, org.springframework.core.env.EnvironmentCapable, org.springframework.web.context.ServletContextAware

public class OAuth2LoginAuthenticationFilter extends AbstractAuthenticationProcessingFilter
An implementation of an AbstractAuthenticationProcessingFilter for OAuth 2.0 Login.

This authentication Filter handles the processing of an OAuth 2.0 Authorization Response for the authorization code grant flow and delegates an OAuth2LoginAuthenticationToken to the AuthenticationManager to log in the End-User.

The OAuth 2.0 Authorization Response is processed as follows:

Since:
5.0
See Also:
  • Field Details

    • DEFAULT_FILTER_PROCESSES_URI

      public static final String DEFAULT_FILTER_PROCESSES_URI
      The default URI where this Filter processes authentication requests.
      See Also:
  • Constructor Details

    • OAuth2LoginAuthenticationFilter

      public OAuth2LoginAuthenticationFilter(ClientRegistrationRepository clientRegistrationRepository, OAuth2AuthorizedClientService authorizedClientService)
      Constructs an OAuth2LoginAuthenticationFilter using the provided parameters.
      Parameters:
      clientRegistrationRepository - the repository of client registrations
      authorizedClientService - the authorized client service
    • OAuth2LoginAuthenticationFilter

      public OAuth2LoginAuthenticationFilter(ClientRegistrationRepository clientRegistrationRepository, OAuth2AuthorizedClientService authorizedClientService, String filterProcessesUrl)
      Constructs an OAuth2LoginAuthenticationFilter using the provided parameters.
      Parameters:
      clientRegistrationRepository - the repository of client registrations
      authorizedClientService - the authorized client service
      filterProcessesUrl - the URI where this Filter will process the authentication requests
    • OAuth2LoginAuthenticationFilter

      public OAuth2LoginAuthenticationFilter(ClientRegistrationRepository clientRegistrationRepository, OAuth2AuthorizedClientRepository authorizedClientRepository, String filterProcessesUrl)
      Constructs an OAuth2LoginAuthenticationFilter using the provided parameters.
      Parameters:
      clientRegistrationRepository - the repository of client registrations
      authorizedClientRepository - the authorized client repository
      filterProcessesUrl - the URI where this Filter will process the authentication requests
      Since:
      5.1
  • Method Details