Table of Contents

Class RequiredScopeExtensions

Namespace
Microsoft.Identity.Web
Assembly
Microsoft.Identity.Web.dll

Extensions for building the required scope attribute during application startup.

public static class RequiredScopeExtensions
Inheritance
RequiredScopeExtensions
Inherited Members

Methods

AddRequiredScopeAuthorization(IServiceCollection)

This method adds support for the required scope attribute. It adds a default policy that adds a scope requirement. This requirement looks for IAuthRequiredScopeMetadata on the current endpoint.

public static IServiceCollection AddRequiredScopeAuthorization(this IServiceCollection services)

Parameters

services IServiceCollection

The services being configured.

Returns

IServiceCollection

Services.

RequireScope<TBuilder>(TBuilder, params string[])

This method adds metadata to route endpoint to describe required scopes. It's the imperative version of the [RequiredScope] attribute.

public static TBuilder RequireScope<TBuilder>(this TBuilder endpointConventionBuilder, params string[] scope) where TBuilder : IEndpointConventionBuilder

Parameters

endpointConventionBuilder TBuilder

To customize the endpoints.

scope string[]

Scope.

Returns

TBuilder

Builder.

Type Parameters

TBuilder

Class implementing IEndpointConventionBuilder.