Class OttSecondFactorToken

java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
com.irurueta.authserver.authorization.api.web.ott.OttSecondFactorToken
All Implemented Interfaces:
Serializable, Principal, org.springframework.security.core.Authentication, org.springframework.security.core.CredentialsContainer

public class OttSecondFactorToken extends org.springframework.security.authentication.AbstractAuthenticationToken
Request to verify a one-time code as a second factor: the authentication the user already holds (the primary factor), the code the user typed and the binding id of the session that requested it. It is never authenticated itself; OttSecondFactorAuthenticationProvider answers with the primary authentication enriched with the authority of the channel.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.springframework.security.authentication.AbstractAuthenticationToken

    org.springframework.security.authentication.AbstractAuthenticationToken.AbstractAuthenticationBuilder<B extends org.springframework.security.authentication.AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>>

    Nested classes/interfaces inherited from interface org.springframework.security.core.Authentication

    org.springframework.security.core.Authentication.Builder<B extends org.springframework.security.core.Authentication.Builder<B>>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final String
    Binding id of the session that requested the code.
    private final String
    The code as typed.
    private final org.springframework.security.core.Authentication
    The authentication the user already holds.
    private static final long
    Serialization version.
  • Constructor Summary

    Constructors
    Constructor
    Description
    OttSecondFactorToken(org.springframework.security.core.Authentication primary, String code, String bindingId)
    Creates the request.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the binding id of the session that requested the code.
    Gets the code.
    Gets the principal.
    org.springframework.security.core.Authentication
    Gets the authentication the user already holds.

    Methods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken

    equals, eraseCredentials, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setAuthenticated, setDetails, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.springframework.security.core.Authentication

    toBuilder

    Methods inherited from interface java.security.Principal

    implies
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version.
      See Also:
    • primary

      private final org.springframework.security.core.Authentication primary
      The authentication the user already holds.
    • code

      private final String code
      The code as typed.
    • bindingId

      private final String bindingId
      Binding id of the session that requested the code.
  • Constructor Details

    • OttSecondFactorToken

      public OttSecondFactorToken(org.springframework.security.core.Authentication primary, String code, String bindingId)
      Creates the request.
      Parameters:
      primary - the authentication the user already holds.
      code - the code as typed.
      bindingId - binding id of the session that requested the code, empty when it requested none.
  • Method Details

    • getCredentials

      public String getCredentials()
      Gets the code.
      Returns:
      the code as typed.
    • getPrincipal

      public Object getPrincipal()
      Gets the principal.
      Returns:
      the principal of the primary authentication.
    • primary

      public org.springframework.security.core.Authentication primary()
      Gets the authentication the user already holds.
      Returns:
      the primary authentication.
    • bindingId

      public String bindingId()
      Gets the binding id of the session that requested the code.
      Returns:
      the binding id.