Show / Hide Table of Contents

Class TokenResponseCacheManager

Cache manager for the IdentityServer4 IdentityModel.Client.TokenResponse.

Inheritance
System.Object
TokenResponseCacheManager
Implements
ITokenResponseCacheManager
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Geko.HttpClientService.Infrastructure
Assembly: Geko.HttpClientService.dll
Syntax
public class TokenResponseCacheManager : ITokenResponseCacheManager
Remarks

It caches a successful response for the 75% of the expiration time define in the IdentityModel.Client.TokenResponse.

Constructors

| Improve this Doc View Source

TokenResponseCacheManager(IMemoryCache)

Constructor of the TokenResponseCacheManager.

Declaration
public TokenResponseCacheManager(IMemoryCache memoryCache)
Parameters
Type Name Description
Microsoft.Extensions.Caching.Memory.IMemoryCache memoryCache

The in-memory cache.

Methods

| Improve this Doc View Source

AddOrGetExistingAsync(String, Func<Task<TokenResponse>>)

Adds a new IdentityModel.Client.TokenResponse in the cache by executing the call parameter, or returns an existing cached response.

Declaration
public async Task<TokenResponse> AddOrGetExistingAsync(string key, Func<Task<TokenResponse>> call)
Parameters
Type Name Description
System.String key

The key of the cache entry.

Func<Task<IdentityModel.Client.TokenResponse>> call

The delegate the returns a IdentityModel.Client.TokenResponse.

Returns
Type Description
Task<IdentityModel.Client.TokenResponse>

A IdentityModel.Client.TokenResponse, either just aqcuired or from the cache

| Improve this Doc View Source

Remove(String)

Removes an entry from the cache

Declaration
public void Remove(string key)
Parameters
Type Name Description
System.String key

The key of the cache entry.

Implements

ITokenResponseCacheManager
  • Improve this Doc
  • View Source
Back to top Generated by DocFX