Class EmbeddedLoginTokenAuthenticationProvider

java.lang.Object
com.broadleafcommerce.auth.user.session.embedded.EmbeddedLoginTokenAuthenticationProvider
All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationProvider

public class EmbeddedLoginTokenAuthenticationProvider extends Object implements org.springframework.security.authentication.AuthenticationProvider
Authenticates the user for the TokenEndpoint based on a one-time passcode parameter.
Author:
Cade Rea (cade-rea)
  • Constructor Details

  • Method Details

    • 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
    • buildEmbeddedLoginTokenEndpointAuthenticationToken

      protected EmbeddedLoginTokenEndpointAuthenticationToken buildEmbeddedLoginTokenEndpointAuthenticationToken(OAuth2UserDetails userDetails, String clientId, String username, String scope, String code, String purpose)
      Parameters:
      userDetails - The UserDetails for the authenticated User.
      clientId - The client_id from the request.
      username - The username of the authenticated User.
      scope - The requested scopes.
      code - The one-time passcode used for authentication.
      purpose - The purpose of the one-time passcode used for authentication.
      Returns:
      An authenticated EmbeddedLoginTokenEndpointAuthenticationToken.
    • buildOAuth2Request

      @Deprecated protected org.springframework.security.oauth2.provider.OAuth2Request buildOAuth2Request(String clientId, OAuth2UserDetails userDetails, String requestedScope)
      Deprecated.
      Build a synthetic OAuth2Request. This is needed to issue tokens from the TokenEndpoint.
      Parameters:
      clientId - The client_id from the request.
      userDetails - The UserDetails for the authenticated User.
      requestedScope - The requested scopes.
      Returns:
      An approved OAuth2Request.
    • buildOAuth2Request

      protected org.springframework.security.oauth2.provider.OAuth2Request buildOAuth2Request(String clientId, String requestedScope, @Nullable User user)
      Build a synthetic OAuth2Request. This is needed to issue tokens from the TokenEndpoint.
      Parameters:
      clientId - The client_id from the request.
      requestedScope - The requested scopes.
      Returns:
      An approved OAuth2Request.
    • supports

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

      protected PasscodeService<PasswordToken,User> getPasscodeService()
    • getUserDetailsService

      protected OAuth2UserDetailsService getUserDetailsService()
    • getUserService

      protected UserService<User> getUserService()
    • getOAuth2RequestFactory

      protected org.springframework.security.oauth2.provider.OAuth2RequestFactory getOAuth2RequestFactory()