Table of Contents

Class ForceOpenIdMiddleWareOptionsExtension

Namespace
Arc4u.OAuth2.Middleware
Assembly
Arc4u.OAuth2.AspNetCore.dll

Registers and adds the ForceOpenIdMiddleWare.

public static class ForceOpenIdMiddleWareOptionsExtension
Inheritance
ForceOpenIdMiddleWareOptionsExtension
Inherited Members

Methods

AddForceOpenId(IServiceCollection, IConfiguration, string)

Registers the ForceOpenIdMiddleWareOptions from a configuration section.

public static IServiceCollection AddForceOpenId(this IServiceCollection services, IConfiguration configuration, string sectionName = "Authentication:ClaimsMiddleWare:ForceOpenId")

Parameters

services IServiceCollection

The service collection.

configuration IConfiguration

The configuration.

sectionName string

The section to bind. The default is Authentication:ClaimsMiddleWare:ForceOpenId.

Returns

IServiceCollection

The service collection, to chain calls.

Examples

builder.Services.AddForceOpenId(builder.Configuration);

Exceptions

ArgumentNullException

An argument is null.

AddForceOpenId(IServiceCollection, Action<ForceOpenIdMiddleWareOptions>)

Registers the ForceOpenIdMiddleWareOptions from code.

public static IServiceCollection AddForceOpenId(this IServiceCollection services, Action<ForceOpenIdMiddleWareOptions> configureOptions)

Parameters

services IServiceCollection

The service collection.

configureOptions Action<ForceOpenIdMiddleWareOptions>

The action that configures the options.

Returns

IServiceCollection

The service collection, to chain calls.

Examples

builder.Services.AddForceOpenId(options =>
{
    options.ForceAuthenticationForPaths.Add("/swagger*");
});

Exceptions

ArgumentNullException

An argument is null.

UseForceOpenId(IApplicationBuilder)

Adds the ForceOpenIdMiddleWare to the request pipeline. Call it after the authentication middleware.

public static IApplicationBuilder UseForceOpenId(this IApplicationBuilder app)

Parameters

app IApplicationBuilder

The application builder.

Returns

IApplicationBuilder

The application builder, to chain calls.

Exceptions

ArgumentNullException

app is null.