public interface Authentication
extends java.io.Serializable
The Authentication object represents a successful authentication request. It contains the principal that the authentication request was made for as well as the additional meta information such as the authenticated date and a map of attributes.
An Authentication object must be serializable to permit persistence and clustering.
Implementing classes must take care to ensure that the Map returned by getAttributes is serializable by using a Serializable map such as HashMap.
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(java.lang.String name,
java.lang.Object value)
Add attribute to the authentication object and update the instance.
|
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
Attributes of the authentication (not the Principal).
|
java.time.ZonedDateTime |
getAuthenticationDate()
Method to retrieve the timestamp of when this Authentication object was
created.
|
java.util.List<CredentialMetaData> |
getCredentials()
Gets a list of metadata about the credentials supplied at authentication time.
|
java.util.Map<java.lang.String,java.lang.Throwable> |
getFailures()
Gets a map describing failed authentications.
|
Principal |
getPrincipal()
Method to obtain the Principal.
|
java.util.Map<java.lang.String,AuthenticationHandlerExecutionResult> |
getSuccesses()
Gets a map describing successful authentications produced by
AuthenticationHandler components. |
void |
update(Authentication authn)
Updates the authentication object with what's passed.
|
void |
updateAll(Authentication authn)
Updates the authentication object with what's passed.
|
Principal getPrincipal()
java.time.ZonedDateTime getAuthenticationDate()
java.util.Map<java.lang.String,java.lang.Object> getAttributes()
void addAttribute(java.lang.String name, java.lang.Object value)
name
- the namevalue
- the valuejava.util.List<CredentialMetaData> getCredentials()
java.util.Map<java.lang.String,AuthenticationHandlerExecutionResult> getSuccesses()
AuthenticationHandler
components.java.util.Map<java.lang.String,java.lang.Throwable> getFailures()
void update(Authentication authn)
authn
- the authn objectvoid updateAll(Authentication authn)
authn
- the authn object