Table of Contents

Class AccessTokenPropagationExtensions

Namespace
Keycloak.AuthServices.Authorization.AuthorizationServer
Assembly
Keycloak.AuthServices.Authorization.dll

Token propagation middleware

public static class AccessTokenPropagationExtensions
Inheritance
AccessTokenPropagationExtensions
Inherited Members

Methods

AddCookieAccessTokenProvider(IServiceCollection, string, string)

public static IServiceCollection AddCookieAccessTokenProvider(this IServiceCollection services, string cookieScheme = "Cookies", string tokenName = "access_token")

Parameters

services IServiceCollection

The service collection.

cookieScheme string

The cookie authentication scheme where tokens are stored. Defaults to AuthenticationScheme ("Cookies").

tokenName string

The name of the token to retrieve. Defaults to "access_token".

Returns

IServiceCollection

The service collection.

Remarks

Use this for OIDC+Cookie Web Apps (AddKeycloakWebAppAuthentication) where access tokens are stored in the cookie scheme via SaveTokens = true. Call this before AddAuthorizationServer, or it will override the default registration.

AddHeaderPropagation(IHttpClientBuilder)

Adds access token propagation middleware to HTTP pipeline

public static IHttpClientBuilder AddHeaderPropagation(this IHttpClientBuilder builder)

Parameters

builder IHttpClientBuilder

Returns

IHttpClientBuilder