Class DuoAuthenticationLifetimeLookupStrategy
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.plugin.authn.duo.DuoAuthenticationLifetimeLookupStrategy
- All Implemented Interfaces:
Function<ProfileRequestContext,,Duration> Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent
public class DuoAuthenticationLifetimeLookupStrategy
extends AbstractIdentifiableInitializableComponent
implements Function<ProfileRequestContext,Duration>
An authentication lifetime lookup strategy that determines the authentication lifetime to enforce.
The lifetime is determined as follows:
- If the
DuoOIDCIntegrationexplicitly specifies a maximum authentication age, that value is used. - Otherwise, if a non-zero
max_agevalue was stored in theDuoOIDCAuthenticationContext, that value is used. - Otherwise, if a fresh authentication was requested (
max_age=0), the reauthentication lifetime lookup strategy is used. - Otherwise, the default authentication lifetime lookup strategy is used.
If either lookup strategy returns null or if no lifetime can be determined, null is returned.
Callers should interpret null as meaning that no authentication lifetime should be enforced.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<ProfileRequestContext,Duration> Lookup strategy to find the amount of time for which the auth_time inside a token is valid for.private final org.slf4j.LoggerClass logger.private Function<ProfileRequestContext,Duration> Lookup strategy to find the amount of time for which the auth_time inside a token is valid for when a 'fresh' authentication is requested. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetAuthnLifetime(Duration lifetime) Set the Lookup strategy to find the default amount of time for which the auth_time inside a token is valid for.voidSet the Lookup strategy to find the default amount of time for which the auth_time inside a token is valid for.voidsetReauthnLifetime(Duration lifetime) Sets the amount of time for which the auth_time inside a token is valid for.voidSets the strategy to determine the amount of time for which the auth_time inside a token is valid for.Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
doInitialize, ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getId
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
authnLifetimeLookupStrategy
Lookup strategy to find the amount of time for which the auth_time inside a token is valid for. Used when no request-specific authentication age requirement has been established. -
reauthnLifetimeLookupStrategy
Lookup strategy to find the amount of time for which the auth_time inside a token is valid for when a 'fresh' authentication is requested. Used when no request-specific authentication age requirement has been established from the Duo Integration used.
-
-
Constructor Details
-
DuoAuthenticationLifetimeLookupStrategy
public DuoAuthenticationLifetimeLookupStrategy()Constructor.
-
-
Method Details
-
setReauthnLifetime
Sets the amount of time for which the auth_time inside a token is valid for. This only applies to requests that require a fresh authentication and no integration-specific authentication age override is present.- Parameters:
lifetime- amount of time for which the auth_time inside a token is valid for. Can benullif a lifetime should not be enforced.
-
setReauthnLifetimeLookupStrategy
public void setReauthnLifetimeLookupStrategy(@Nonnull Function<ProfileRequestContext, Duration> strategy) Sets the strategy to determine the amount of time for which the auth_time inside a token is valid for. This only applies to requests that require a fresh authentication and no integration-specific authentication age override is present.- Parameters:
strategy- the strategy. Can returnnullif a lifetime should not be enforced.
-
setAuthnLifetime
Set the Lookup strategy to find the default amount of time for which the auth_time inside a token is valid for. This only applies to requests that did not specify an authentication age.- Parameters:
lifetime- amount of time for which the auth_time inside a token is valid for. Can benullif a lifetime should not be enforced.
-
setAuthnLifetimeLookupStrategy
public void setAuthnLifetimeLookupStrategy(@Nonnull Function<ProfileRequestContext, Duration> strategy) Set the Lookup strategy to find the default amount of time for which the auth_time inside a token is valid for. This only applies to requests that did not specify an authentication age.- Parameters:
strategy- the strategy. Can returnnullif a lifetime should not be enforced.
-
apply
- Specified by:
applyin interfaceFunction<ProfileRequestContext,Duration>
-