Skip to content

An interceptor from AuthorizationInterceptor that uses Redis as DistributedCache for handle authorization headers

License

Notifications You must be signed in to change notification settings

Adolfok3/AuthorizationInterceptor.Extensions.Redis

Repository files navigation

AuthorizationInterceptor Icon

AuthorizationInterceptor.Extensions.Redis

GithubActions License Coverage Status NuGet Version

An interceptor for AuthorizationInterceptor that uses a distributed cache with Redis to handle authorization headers. For more information on how to configure and use Authorization Interceptor, please check the main page of AuthorizationInterceptor.

Installation

Run the following command in package manager console:

PM> Install-Package AuthorizationInterceptor.Extensions.Redis

Or from the .NET CLI as:

dotnet add package AuthorizationInterceptor.Extensions.Redis

Setup

When adding Authorization Interceptor Handler, call the extension method UseStackExchangeRedisCacheInterceptor to options passing the redis options:

services.AddHttpClient("TargetApi")
        .AddAuthorizationInterceptorHandler<TargetApiAuthClass>(options =>
		{
			options.UseStackExchangeRedisCacheInterceptor(redisOptions => 
			{
				redisOptions.Configuration = "redisConnStr";
				redisOptions.InstanceName = "target_api";
			});
		})

About

An interceptor from AuthorizationInterceptor that uses Redis as DistributedCache for handle authorization headers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages