Class CachingAccessTokenResolver

    • Constructor Detail

      • CachingAccessTokenResolver

        public CachingAccessTokenResolver​(org.forgerock.util.time.TimeService time,
                                          AccessTokenResolver resolver,
                                          org.forgerock.util.PerItemEvictionStrategyCache<String,​org.forgerock.util.promise.Promise<AccessTokenInfo,​AccessTokenException>> cache)
        Builds a CachingAccessTokenResolver delegating to the given AccessTokenResolver using the given (pre-configured) cache.
        Parameters:
        time - Time service used to compute the token cache time-to-live
        resolver - resolver to delegates to
        cache - access token cache
    • Method Detail

      • resolve

        public org.forgerock.util.promise.Promise<AccessTokenInfo,​AccessTokenException> resolve​(org.forgerock.services.context.Context context,
                                                                                                      String token)
        Description copied from interface: AccessTokenResolver
        Resolves a given access token against an authorization server.
        Specified by:
        resolve in interface AccessTokenResolver
        Parameters:
        context - Context chain used to keep a relationship between requests (tracking)
        token - token identifier to be resolved
        Returns:
        a promise completed either with a valid AccessTokenInfo (well-formed, known by the server), or by an exception