public class AuthenticationFlowDescriptor extends net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent implements PrincipalSupportingComponent, com.google.common.base.Predicate<org.opensaml.profile.context.ProfileRequestContext>, org.opensaml.storage.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<org.opensaml.profile.context.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 org.opensaml.storage.StorageSerializer<AuthenticationResult> |
resultSerializer
Custom serializer for the results generated by this flow.
|
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(org.opensaml.profile.context.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.
|
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<org.opensaml.profile.context.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(org.opensaml.storage.StorageSerializer<AuthenticationResult> serializer)
Set a custom serializer for results produced by this flow.
|
<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, wait@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
@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<org.opensaml.profile.context.ProfileRequestContext> activationCondition
@Nullable private org.opensaml.storage.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.@NonNegative public long getLifetime()
public void setLifetime(@Duration@NonNegative
long flowLifetime)
flowLifetime - the lifetime for the flow, must be 0 or greater@Positive public long getInactivityTimeout()
Defaults to 30 minutes.
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<org.opensaml.profile.context.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(org.opensaml.profile.context.ProfileRequestContext input)
apply in interface com.google.common.base.Predicate<org.opensaml.profile.context.ProfileRequestContext>public void setResultSerializer(@Nonnull org.opensaml.storage.StorageSerializer<AuthenticationResult> serializer)
serializer - the custom serializerprotected void doInitialize()
throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize in class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponentnet.shibboleth.utilities.java.support.component.ComponentInitializationException@Nonnull @NotEmpty public String serialize(@Nonnull AuthenticationResult instance) throws IOException
serialize in interface org.opensaml.storage.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 org.opensaml.storage.StorageSerializer<AuthenticationResult>IOExceptionpublic boolean equals(Object obj)
Copyright © 1999–2015. All rights reserved.