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
Binding id of the session that requested the code.
private final org.springframework.security.core.Authentication
The authentication the user already holds.
private static final long
Constructor Summary
Constructors
Method Summary
All Methods Instance Methods Concrete Methods
Gets the binding id of the session that requested the code.
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 interface org.springframework.security.core.Authentication
toBuilder
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.
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
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
Gets the binding id of the session that requested the code.
Returns:
the binding id.