Table of Contents

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

services IServiceCollection

The service collection.

Examples

builder.Services.AddOpenIdBearerInjector();

Exceptions

ArgumentNullException

services is null.

AddOpenIdBearerInjector(IServiceCollection, Action<OpenIdBearerInjectorOptions>)

Registers the OpenIdBearerInjectorOptions from code.

public static void AddOpenIdBearerInjector(this IServiceCollection services, Action<OpenIdBearerInjectorOptions> options)

Parameters

services IServiceCollection

The service collection.

options Action<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

app IApplicationBuilder

The application builder.

Returns

IApplicationBuilder

The application builder, to chain calls.

Exceptions

ArgumentNullException

app is null.