Class 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 uses different lookup strategies depending on whether a 'fresh' authentication has been requested or not. That is, it determines, indirectly, how long a Duo authentication should be considered valid.

A null value from a lookup strategy is passed back to the caller as null. A null value should be interpreted as, do not enforce authentication lifetime.

  • Field Details

    • log

      @Nonnull private final org.slf4j.Logger log
      Class logger.
    • authnLifetimeLookupStrategy

      @Nonnull private Function<ProfileRequestContext,Duration> authnLifetimeLookupStrategy
      Lookup strategy to find the amount of time for which the auth_time inside a token is valid for.
    • reauthnLifetimeLookupStrategy

      @Nonnull private Function<ProfileRequestContext,Duration> 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.
  • Constructor Details

    • DuoAuthenticationLifetimeLookupStrategy

      public DuoAuthenticationLifetimeLookupStrategy()
      Constructor.
  • Method Details

    • setReauthnLifetime

      public void setReauthnLifetime(@Nullable Duration lifetime)
      Sets the amount of time for which the auth_time inside a token is valid for. That is, the time from which the end-user interactively authenticated. This only applies to requests that require a fresh authentication e.g. using forcedAuthn or max_age=0.
      Parameters:
      lifetime - amount of time for which the auth_time inside a token is valid for. Can be null if a lifetime should not be enforced.
    • setReauthnLifetimeLookupStrategy

      public void setReauthnLifetimeLookupStrategy(@Nonnull Function<ProfileRequestContext,Duration> strategy)
      Set the Lookup strategy to find the amount of time for which the auth_time inside a token is valid for. That is, the time from which the end-user interactively authenticated. This only applies to requests that require a fresh authentication e.g. using forcedAuthn or max_age=0.
      Parameters:
      strategy - the strategy. Can return null if a lifetime should not be enforced.
    • setAuthnLifetime

      public void setAuthnLifetime(@Nullable Duration lifetime)
      Sets the amount of time for which the auth_time inside a token is valid for. That is, the time from which the end-user interactively authenticated. This only applies to requests that do not require a fresh authentication.
      Parameters:
      lifetime - amount of time for which the auth_time inside a token is valid for. Can be null if a lifetime should not be enforced.
    • setAuthnLifetimeLookupStrategy

      public void setAuthnLifetimeLookupStrategy(@Nonnull Function<ProfileRequestContext,Duration> strategy)
      Set the Lookup strategy to find the amount of time for which the auth_time inside a token is valid for. That is, the time from which the end-user interactively authenticated. This only applies to requests that do not require a fresh authentication.
      Parameters:
      strategy - the strategy. Can return null if a lifetime should not be enforced.
    • apply

      public Duration apply(@Nullable ProfileRequestContext prc)
      Specified by:
      apply in interface Function<ProfileRequestContext,Duration>