Class OneTimeTokenAuthentication
- All Implemented Interfaces:
Serializable
,Principal
,Authentication
,BuildableAuthentication
,CredentialsContainer
- Since:
- 7.0
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.springframework.security.authentication.AbstractAuthenticationToken
AbstractAuthenticationToken.AbstractAuthenticationBuilder<B extends AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>>
-
Constructor Summary
ConstructorsModifierConstructorDescriptionOneTimeTokenAuthentication
(Object principal, Collection<? extends GrantedAuthority> authorities) protected
-
Method Summary
Modifier and TypeMethodDescription@Nullable Object
The credentials that prove the principal is correct.The identity of the principal being authenticated.Return anAuthentication.Builder
based on this instance.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
getAuthorities, getDetails, isAuthenticated, setAuthenticated
-
Constructor Details
-
OneTimeTokenAuthentication
public OneTimeTokenAuthentication(Object principal, Collection<? extends GrantedAuthority> authorities) -
OneTimeTokenAuthentication
-
-
Method Details
-
getPrincipal
Description copied from interface:Authentication
The identity of the principal being authenticated. In the case of an authentication request with username and password, this would be the username. Callers are expected to populate the principal for an authentication request.The AuthenticationManager implementation will often return an Authentication containing richer information as the principal for use by the application. Many of the authentication providers will create a
UserDetails
object as the principal.- Specified by:
getPrincipal
in interfaceAuthentication
- Returns:
- the
Principal
being authenticated or the authenticated principal after authentication.
-
getCredentials
Description copied from interface:Authentication
The credentials that prove the principal is correct. This is usually a password, but could be anything relevant to theAuthenticationManager
. Callers are expected to populate the credentials.- Specified by:
getCredentials
in interfaceAuthentication
- Returns:
- the credentials that prove the identity of the
Principal
-
toBuilder
Description copied from interface:BuildableAuthentication
Return anAuthentication.Builder
based on this instance.Although a
default
method, allBuildableAuthentication
implementations should implement this. The reason is to ensure that theBuildableAuthentication
type is preserved whenAuthentication.Builder.build()
is invoked. This is especially important in the event that your authentication implementation contains custom fields.This isn't strictly necessary since it is recommended that applications code to the
Authentication
interface and that custom information is often contained in theAuthentication.getPrincipal()
value.- Specified by:
toBuilder
in interfaceBuildableAuthentication
- Returns:
- an
Authentication.Builder
for building a newAuthentication
based on this instance
-