@ThreadSafe public class AuthenticationResult extends Object implements PrincipalSupportingComponent
Any authentication flow that succeeds must produce a single instance of this object. It may be composite, in the sense that it may represent a combination of separate exchanges that make up a single overall result, but the IdP always acts on a single result as the product of a given request for a login.
| Modifier and Type | Field and Description |
|---|---|
private String |
authenticationFlowId
The identifier of the flow used to produce this result.
|
private long |
authenticationInstant
The time, in milliseconds since the epoch, that the authentication completed.
|
private long |
lastActivityInstant
The last time, in milliseconds since the epoch, this result was used to bypass authentication.
|
private boolean |
previousResult
Tracks whether a result was loaded from a previous session or created as part of the current request.
|
private Subject |
subject
The Subject established by the authentication result.
|
| Constructor and Description |
|---|
AuthenticationResult(String flowId,
Principal principal)
Constructor.
|
AuthenticationResult(String flowId,
Subject newSubject)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getAuthenticationFlowId()
Get the flow used to authenticate the principal.
|
long |
getAuthenticationInstant()
Get the time, in milliseconds since the epoch, that the authentication completed.
|
long |
getLastActivityInstant()
Get the last time, in milliseconds since the epoch, this result was used for authentication.
|
Subject |
getSubject()
Get the Subject identifying the authenticated entity.
|
private String |
getSubjectName()
Get a suitable principal name for logging/debugging use.
|
<T extends Principal> |
getSupportedPrincipals(Class<T> c)
Get an immutable set of supported custom principals that the component produces, supports, contains, etc.
|
int |
hashCode() |
boolean |
isPreviousResult()
Get whether this result was loaded from a session as the product of a previous request.
|
void |
setAuthenticationInstant(long instant)
Set the time, in milliseconds since the epoch, that the authentication completed.
|
void |
setLastActivityInstant(long instant)
Set the last time, in milliseconds since the epoch, result was used for authentication.
|
void |
setLastActivityInstantToNow()
Set the last activity instant, in milliseconds since the epoch, for this result to the current time.
|
void |
setPreviousResult(boolean flag)
Set whether this result was loaded from a session as the product of a previous request.
|
String |
toString() |
@Nonnull private final Subject subject
@Nonnull @NotEmpty private final String authenticationFlowId
@Positive private long authenticationInstant
@Positive private long lastActivityInstant
private boolean previousResult
public AuthenticationResult(@Nonnull@NotEmpty String flowId, @Nonnull Subject newSubject)
Sets the authentication instant to the current time.
flowId - the workflow used to authenticate the subjectnewSubject - a Subject identifying the authenticated entitypublic AuthenticationResult(@Nonnull@NotEmpty String flowId, @Nonnull Principal principal)
Sets the authentication instant to the current time.
flowId - the workflow used to authenticate the subjectprincipal - a Principal identifying the authenticated entity@Nonnull public Subject getSubject()
@Nonnull @NonnullElements @Unmodifiable public <T extends Principal> Set<T> getSupportedPrincipals(@Nonnull Class<T> c)
getSupportedPrincipals in interface PrincipalSupportingComponentT - type of Principal to inquire onc - type of Principal to inquire on@Nonnull @NotEmpty public String getAuthenticationFlowId()
@Positive public long getAuthenticationInstant()
public void setAuthenticationInstant(@Positive long instant)
instant - time, in milliseconds since the epoch, that the authentication completed, never non-positive@Positive public long getLastActivityInstant()
public void setLastActivityInstant(@Positive long instant)
instant - last time, in milliseconds since the epoch, result was used to bypass authenticationpublic void setLastActivityInstantToNow()
public boolean isPreviousResult()
public void setPreviousResult(boolean flag)
flag - flag to setCopyright © 1999–2018 Shibboleth Consortium. All rights reserved.