Class PublicRefreshOAuth2AuthorizationCodeAuthenticationProvider

java.lang.Object
com.broadleafcommerce.auth.authorization.security.spring.PublicRefreshOAuth2AuthorizationCodeAuthenticationProvider
All Implemented Interfaces:
org.springframework.core.Ordered, org.springframework.security.authentication.AuthenticationProvider

public final class PublicRefreshOAuth2AuthorizationCodeAuthenticationProvider extends Object implements org.springframework.security.authentication.AuthenticationProvider, org.springframework.core.Ordered
An AuthenticationProvider implementation for the OAuth 2.0 Authorization Code Grant. This is a customized version of the original Spring class (OAuth2AuthorizationCodeAuthenticationProvider). Originally, customization was necessary as the base class disallowed public clients from obtaining any kind of refresh token, and thus we had to remove those validations. As of Spring Authorization Server 1.2.0, this limitation was reversed. Now, this customization primarily focuses on ensuring custom behavior in AdvancedOAuth2RefreshTokenGenerator works as expected.
See Also:
  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    PublicRefreshOAuth2AuthorizationCodeAuthenticationProvider(org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService authorizationService, org.springframework.security.oauth2.server.authorization.token.OAuth2TokenGenerator<? extends org.springframework.security.oauth2.core.OAuth2Token> tokenGenerator, TokenProperties tokenProperties)
    Constructs an OAuth2AuthorizationCodeAuthenticationProvider using the provided parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.security.core.Authentication
    authenticate(org.springframework.security.core.Authentication authentication)
     
    int
     
    void
    setSessionRegistry(org.springframework.security.core.session.SessionRegistry sessionRegistry)
    Sets the SessionRegistry used to track OpenID Connect sessions.
    boolean
    supports(Class<?> authentication)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PublicRefreshOAuth2AuthorizationCodeAuthenticationProvider

      public PublicRefreshOAuth2AuthorizationCodeAuthenticationProvider(org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService authorizationService, org.springframework.security.oauth2.server.authorization.token.OAuth2TokenGenerator<? extends org.springframework.security.oauth2.core.OAuth2Token> tokenGenerator, TokenProperties tokenProperties)
      Constructs an OAuth2AuthorizationCodeAuthenticationProvider using the provided parameters.
      Parameters:
      authorizationService - the authorization service
      tokenGenerator - the token generator
      Since:
      0.2.3
  • Method Details

    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered
    • authenticate

      public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException
      Specified by:
      authenticate in interface org.springframework.security.authentication.AuthenticationProvider
      Throws:
      org.springframework.security.core.AuthenticationException
    • supports

      public boolean supports(Class<?> authentication)
      Specified by:
      supports in interface org.springframework.security.authentication.AuthenticationProvider
    • setSessionRegistry

      public void setSessionRegistry(org.springframework.security.core.session.SessionRegistry sessionRegistry)
      Sets the SessionRegistry used to track OpenID Connect sessions.
      Parameters:
      sessionRegistry - the SessionRegistry used to track OpenID Connect sessions
      Since:
      1.1