Class EmbeddedLoginCodeAuthenticationToken

java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
com.broadleafcommerce.auth.authorization.security.embedded.code.EmbeddedLoginCodeAuthenticationToken
All Implemented Interfaces:
Serializable, Principal, org.springframework.security.core.Authentication, org.springframework.security.core.CredentialsContainer

public class EmbeddedLoginCodeAuthenticationToken extends org.springframework.security.authentication.AbstractAuthenticationToken
Authentication Request Token for the OAuth2TokenEndpointFilter when using Embedded Login.
Author:
Cade Rea (cade-rea)
See Also:
  • Constructor Details

    • EmbeddedLoginCodeAuthenticationToken

      public EmbeddedLoginCodeAuthenticationToken(String clientId, String username, Set<String> requestedScopes, String code, String purpose, Map<String,Object> additionalParameters)
      Constructor for pre-authentication usage. Sets authenticated to false.
      Parameters:
      clientId - The client_id from the request.
      username - The User's username.
      requestedScopes - The scope of the authentication.
      code - The one-time passcode used for authentication.
      purpose - The purpose of the one-time passcode used for authentication.
    • EmbeddedLoginCodeAuthenticationToken

      public EmbeddedLoginCodeAuthenticationToken(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, OAuth2UserDetails userDetails, String clientId, String username, Set<String> requestedScopes, String purpose, Map<String,Object> additionalParameters)
      Constructor for post-authentication. Sets authenticated to true.
      Parameters:
      authorities - The authorities to grant to the user
      userDetails - The id of the user
      clientId - The client_id from the request.
      username - The User's username.
      requestedScopes - The scope of the authentication.
      purpose - The purpose of the one-time passcode used for authentication.
  • Method Details

    • getCredentials

      public Object getCredentials()
    • getPrincipal

      public Object getPrincipal()
    • getClientId

      public String getClientId()
    • getUsername

      public String getUsername()
    • getUserDetails

      public OAuth2UserDetails getUserDetails()
    • getRequestedScopes

      public Set<String> getRequestedScopes()
    • getCode

      public String getCode()
    • getPurpose

      public String getPurpose()
    • getAdditionalParameters

      public Map<String,Object> getAdditionalParameters()
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Principal
      Overrides:
      equals in class org.springframework.security.authentication.AbstractAuthenticationToken
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Principal
      Overrides:
      hashCode in class org.springframework.security.authentication.AbstractAuthenticationToken