public class AuthenticationFlowDescriptor extends AbstractIdentifiableInitializableComponent implements PrincipalSupportingComponent, com.google.common.base.Predicate<ProfileRequestContext>, StorageSerializer<AuthenticationResult>
A flow models a sequence of profile actions that performs authentication in a particular way and satisfies various
constraints that may apply to an authentication request. Some of these constraints are directly exposed as properties
of the flow, and others can be found by examining the list of extended Principals that the flow exposes.
| Modifier and Type | Field and Description |
|---|---|
private com.google.common.base.Predicate<ProfileRequestContext> |
activationCondition
Predicate that must be true for this flow to be usable for a given request.
|
static String |
FLOW_ID_PREFIX
Prefix convention for flow IDs.
|
private long |
inactivityTimeout
Maximum amount of time in milliseconds, since last usage, a flow should be considered active.
|
private long |
lifetime
Maximum amount of time in milliseconds, since first usage, a flow should be considered active.
|
private StorageSerializer<AuthenticationResult> |
resultSerializer
Custom serializer for the results generated by this flow.
|
private com.google.common.base.Predicate<ProfileRequestContext> |
reuseCondition
Whether this flow allows reuse of its results.
|
static long |
STORAGE_EXPIRATION_OFFSET
Additional allowance for storage of result records to avoid race conditions during use.
|
private Subject |
supportedPrincipals
Supported principals, indexed by type, that the flow can produce.
|
private boolean |
supportsForced
Whether this flow supports forced authentication.
|
private boolean |
supportsNonBrowser
Whether this flow supports non-browser clients.
|
private boolean |
supportsPassive
Whether this flow supports passive authentication.
|
| Constructor and Description |
|---|
AuthenticationFlowDescriptor()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
apply(ProfileRequestContext input) |
AuthenticationResult |
deserialize(long version,
String context,
String key,
String value,
Long expiration) |
protected void |
doInitialize() |
boolean |
equals(Object obj) |
long |
getInactivityTimeout()
Get the maximum amount of time in milliseconds, since the last usage, a flow should be considered active.
|
long |
getLifetime()
Get the maximum amount of time in milliseconds, since first usage, a flow should be considered active.
|
com.google.common.base.Predicate<ProfileRequestContext> |
getReuseCondition()
Get condition controlling whether results from this flow should be reused for SSO.
|
Collection<Principal> |
getSupportedPrincipals()
Get a collection of supported non-user-specific principals that the flow may produce when it operates.
|
<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 |
isForcedAuthenticationSupported()
Get whether this flow supports forced authentication.
|
boolean |
isNonBrowserSupported()
Get whether this flow supports non-browser clients.
|
boolean |
isPassiveAuthenticationSupported()
Get whether this flow supports passive authentication.
|
boolean |
isResultActive(AuthenticationResult result)
Check if a result generated by this flow is still active.
|
String |
serialize(AuthenticationResult instance) |
void |
setActivationCondition(com.google.common.base.Predicate<ProfileRequestContext> condition)
Set the activation condition in the form of a
Predicate such that iff the condition evaluates to true
should the corresponding flow be allowed/possible. |
void |
setForcedAuthenticationSupported(boolean isSupported)
Set whether this flow supports forced authentication.
|
void |
setInactivityTimeout(long timeout)
Set the maximum amount of time in milliseconds, since the last usage, a flow should be considered active.
|
void |
setLifetime(long flowLifetime)
Set the maximum amount of time in milliseconds, since first usage, a flow should be considered active.
|
void |
setNonBrowserSupported(boolean isSupported)
Set whether this flow supports non-browser clients.
|
void |
setPassiveAuthenticationSupported(boolean isSupported)
Set whether this flow supports passive authentication.
|
void |
setResultSerializer(StorageSerializer<AuthenticationResult> serializer)
Set a custom serializer for results produced by this flow.
|
void |
setReuseCondition(com.google.common.base.Predicate<ProfileRequestContext> condition)
Set condition controlling whether results from this flow should be reused for SSO.
|
<T extends Principal> |
setSupportedPrincipals(Collection<T> principals)
Set supported non-user-specific principals that the flow may produce when it operates.
|
String |
toString() |
setIdgetIddestroy, doDestroy, initialize, isDestroyed, isInitializedclone, finalize, getClass, notify, notifyAll, wait, wait, waitinitialize, isInitializedgetId@Nonnull @NotEmpty public static final String FLOW_ID_PREFIX
public static final long STORAGE_EXPIRATION_OFFSET
private boolean supportsNonBrowser
private boolean supportsPassive
private boolean supportsForced
@Nonnull private com.google.common.base.Predicate<ProfileRequestContext> reuseCondition
@Duration @NonNegative private long lifetime
@Duration @Positive private long inactivityTimeout
@Nonnull private Subject supportedPrincipals
getSupportedPrincipals(java.lang.Class<T>) method.@Nonnull private com.google.common.base.Predicate<ProfileRequestContext> activationCondition
@Nullable private StorageSerializer<AuthenticationResult> resultSerializer
public boolean isNonBrowserSupported()
public void setNonBrowserSupported(boolean isSupported)
isSupported - whether this flow supports non-browser clientspublic boolean isPassiveAuthenticationSupported()
public void setPassiveAuthenticationSupported(boolean isSupported)
isSupported - whether this flow supports passive authenticationpublic boolean isForcedAuthenticationSupported()
public void setForcedAuthenticationSupported(boolean isSupported)
isSupported - whether this flow supports forced authentication.@Nonnull public com.google.common.base.Predicate<ProfileRequestContext> getReuseCondition()
public void setReuseCondition(@Nonnull com.google.common.base.Predicate<ProfileRequestContext> condition)
Defaults to Predicates.alwaysTrue().
condition - condition to set@NonNegative @Duration public long getLifetime()
@Duration public void setLifetime(@Duration@NonNegative long flowLifetime)
flowLifetime - the lifetime for the flow, must be 0 or greater@Duration @Positive public long getInactivityTimeout()
Defaults to 30 minutes.
@Duration public void setInactivityTimeout(@Duration@Positive long timeout)
timeout - the flow inactivity timeout, must be greater than zeropublic boolean isResultActive(@Nonnull AuthenticationResult result)
result - AuthenticationResult to check@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 @NonnullElements public Collection<Principal> getSupportedPrincipals()
The Collection.remove(java.lang.Object) method is not supported.
public <T extends Principal> void setSupportedPrincipals(@Nonnull@NonnullElements Collection<T> principals)
T - a type of principal to add, if not genericprincipals - supported principals to addpublic void setActivationCondition(@Nonnull com.google.common.base.Predicate<ProfileRequestContext> condition)
Predicate such that iff the condition evaluates to true
should the corresponding flow be allowed/possible.condition - predicate that controls activation of the flowpublic boolean apply(@Nullable ProfileRequestContext input)
apply in interface com.google.common.base.Predicate<ProfileRequestContext>public void setResultSerializer(@Nonnull StorageSerializer<AuthenticationResult> serializer)
serializer - the custom serializerprotected void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractIdentifiedInitializableComponentComponentInitializationException@Nonnull @NotEmpty public String serialize(@Nonnull AuthenticationResult instance) throws IOException
serialize in interface StorageSerializer<AuthenticationResult>IOException@Nonnull public AuthenticationResult deserialize(long version, @Nonnull@NotEmpty String context, @Nonnull@NotEmpty String key, @Nonnull@NotEmpty String value, @Nonnull Long expiration) throws IOException
deserialize in interface StorageSerializer<AuthenticationResult>IOExceptionpublic boolean equals(Object obj)
equals in interface com.google.common.base.Predicate<ProfileRequestContext>equals in class ObjectCopyright © 1999–2018 Shibboleth Consortium. All rights reserved.