Class OpenIdBearerInjectorMiddlewareExtension
- Namespace
- Arc4u.OAuth2.Middleware
- Assembly
- Arc4u.OAuth2.AspNetCore.dll
Registers and adds the OpenIdBearerInjectorMiddleware.
public static class OpenIdBearerInjectorMiddlewareExtension
- Inheritance
-
OpenIdBearerInjectorMiddlewareExtension
- Inherited Members
Methods
AddOpenIdBearerInjector(IServiceCollection)
Registers the OpenIdBearerInjectorOptions with their default values.
public static void AddOpenIdBearerInjector(this IServiceCollection services)
Parameters
servicesIServiceCollectionThe service collection.
Examples
builder.Services.AddOpenIdBearerInjector();
Exceptions
- ArgumentNullException
servicesis null.
AddOpenIdBearerInjector(IServiceCollection, Action<OpenIdBearerInjectorOptions>)
Registers the OpenIdBearerInjectorOptions from code.
public static void AddOpenIdBearerInjector(this IServiceCollection services, Action<OpenIdBearerInjectorOptions> options)
Parameters
servicesIServiceCollectionThe service collection.
optionsAction<OpenIdBearerInjectorOptions>The action that configures the options.
Examples
builder.Services.AddOpenIdBearerInjector(options =>
{
options.OboProviderKey = "Obo";
});
Exceptions
- ArgumentNullException
An argument is null.
- ConfigurationException
The on-behalf-of settings key or the provider key is empty.
UseOpenIdBearerInjector(IApplicationBuilder)
Adds the OpenIdBearerInjectorMiddleware to the request pipeline. Call it after the authentication middleware.
public static IApplicationBuilder UseOpenIdBearerInjector(this IApplicationBuilder app)
Parameters
appIApplicationBuilderThe application builder.
Returns
- IApplicationBuilder
The application builder, to chain calls.
Exceptions
- ArgumentNullException
appis null.