Class SetRefreshTokenToResponseContext

    • Constructor Detail

      • SetRefreshTokenToResponseContext

        public SetRefreshTokenToResponseContext​(@Nonnull @ParameterName(name="sealer")
                                                DataSealer sealer)
        Constructor.
        Parameters:
        sealer - sealer to encrypt/hmac refresh token.
    • Method Detail

      • setRevocationCache

        public void setRevocationCache​(@Nonnull
                                       RevocationCache cache)
        Set the revocation cache instance to use.
        Parameters:
        cache - The revocationCache to set.
      • setRefreshTokenChainLifetimeLookupStrategy

        public void setRefreshTokenChainLifetimeLookupStrategy​(@Nonnull
                                                               Function<ProfileRequestContext,​Duration> strategy)
        Set the strategy used to obtain the refresh token chain lifetime.
        Parameters:
        strategy - lookup strategy
      • setRefreshTokenTimeoutLookupStrategy

        public void setRefreshTokenTimeoutLookupStrategy​(@Nonnull
                                                         Function<ProfileRequestContext,​Duration> strategy)
        Set the strategy used to obtain the refresh token timeout.
        Parameters:
        strategy - lookup strategy
      • setEnforceRefreshTokenRotationCondition

        public void setEnforceRefreshTokenRotationCondition​(@Nonnull
                                                            Predicate<ProfileRequestContext> condition)
        Set the condition used to determine whether to revoke refresh tokens once they're used.
        Parameters:
        condition - condition to apply
      • setTokenRevocationLifetimeLookupStrategy

        public void setTokenRevocationLifetimeLookupStrategy​(@Nullable
                                                             Function<com.nimbusds.jwt.JWTClaimsSet,​Duration> strategy)
        Set a lookup strategy for the token revocation lifetime.
        Parameters:
        strategy - What to set.
      • getExistingChainExp

        protected Instant getExistingChainExp​(com.nimbusds.jwt.JWTClaimsSet claimsSet)
        Get the possibly existing chain expiration instant from the claims set.
        Parameters:
        claimsSet - the claims set input
        Returns:
        the existing value if exists, null otherwise
      • calculateChainExp

        protected Instant calculateChainExp()
        Calculates the chain expiration time by taking the closest from the existing item in the claims set (if exists) and the value calculated via current profile configuration.
        Returns:
        the instant to be used as the chain expiration time