HttpFs.Auth0


TokenCache

Namespace: HttpFs.Auth0

Operations for interacting with a TokenCache.

Functions and values

Function or valueDescription
create ()
Signature: unit -> Job<TokenCache>

Creates a new token cache.

putAuthenticationResultJob cep tc cp arJ
Signature: cep:CacheExpirationParameters -> tc:TokenCache -> cp:ClientParams -> arJ:Job<AuthenticationResult> -> Alt<unit>

Processes an authentication result, caching the value for a particular client using the cache expiration parameters provided.

putToken tc cp at exp
Signature: tc:TokenCache -> cp:ClientParams -> at:Auth0Token -> exp:int64 -> Alt<unit>

Adds a token to the cache with the specified expiration time (in UNIX time).

tryGetEntry tc cp
Signature: tc:TokenCache -> cp:ClientParams -> Job<TokenCacheEntry option>

Attempts to get an Auth0 authentication result from the cache. Does not check the expiration of the returned value.

tryGetToken cep tc cp
Signature: cep:CacheExpirationParameters -> tc:TokenCache -> cp:ClientParams -> Job<Auth0Token option>

Attempts to get an unexpired Auth0 authentication token from the cache.

tryGetTokenWithFill cep cp2arJ tc cp
Signature: cep:CacheExpirationParameters -> cp2arJ:(ClientParams -> '?7663) -> tc:TokenCache -> cp:ClientParams -> Job<Auth0Token option>
Type parameters: '?7663

Attempts to get an unexpired Auth0 authentication token from the cache. If the token is expired or doesn't exist in the cache, gets an authentication result and adds it to the cache. The token provided by this authentication result is then returned. The token is added in such a way that if there are multiple concurrent requests for the same token, they will await the same response.

Fork me on GitHub