Class AccessTokenPropagationExtensions
- Assembly
- Keycloak.AuthServices.Authorization.dll
Token propagation middleware
public static class AccessTokenPropagationExtensions
- Inheritance
-
AccessTokenPropagationExtensions
- Inherited Members
Methods
AddCookieAccessTokenProvider(IServiceCollection, string, string)
Registers CookieAccessTokenProvider as the IKeycloakAccessTokenProvider, replacing the default HttpContextAccessTokenProvider.
public static IServiceCollection AddCookieAccessTokenProvider(this IServiceCollection services, string cookieScheme = "Cookies", string tokenName = "access_token")
Parameters
servicesIServiceCollectionThe service collection.
cookieSchemestringThe cookie authentication scheme where tokens are stored. Defaults to AuthenticationScheme ("Cookies").
tokenNamestringThe 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
builderIHttpClientBuilder