Class EmbeddedLoginTokenEndpointAuthenticationToken

  • All Implemented Interfaces:
    Serializable, Principal, org.springframework.security.core.Authentication, org.springframework.security.core.CredentialsContainer

    public class EmbeddedLoginTokenEndpointAuthenticationToken
    extends org.springframework.security.authentication.AbstractAuthenticationToken
    Authentication Token for the TokenEndpoint when using Embedded Login.
    Author:
    Cade Rea (cade-rea)
    See Also:
    Serialized Form
    • Constructor Detail

      • EmbeddedLoginTokenEndpointAuthenticationToken

        public EmbeddedLoginTokenEndpointAuthenticationToken​(String clientId,
                                                             String username,
                                                             String scope,
                                                             String code,
                                                             String purpose)
        Constructor for pre-authentication usage. Sets authenticated to false.
        Parameters:
        clientId - The client_id from the request.
        username - The User's username.
        scope - The scope of the authentication.
        code - The one-time passcode used for authentication.
        purpose - The purpose of the one-time passcode used for authentication.
      • EmbeddedLoginTokenEndpointAuthenticationToken

        public EmbeddedLoginTokenEndpointAuthenticationToken​(Collection<? extends org.springframework.security.core.GrantedAuthority> authorities,
                                                             String userId,
                                                             String clientId,
                                                             String username,
                                                             String scope,
                                                             String code,
                                                             String purpose)
        Constructor for post-authentication. Sets authenticated to true.
        Parameters:
        authorities - The authorities to grant to the user
        userId - The id of the user
        clientId - The client_id from the request.
        username - The User's username.
        scope - The scope of the authentication.
        code - The one-time passcode used for authentication.
        purpose - The purpose of the one-time passcode used for authentication.
    • Method Detail

      • getCredentials

        public Object getCredentials()
      • getPrincipal

        public Object getPrincipal()
      • getClientId

        public String getClientId()
      • getUsername

        public String getUsername()
      • getUserId

        public String getUserId()
      • getScope

        public String getScope()
      • getCode

        public String getCode()
      • getPurpose

        public String getPurpose()
      • 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