Share via


AuthorizationOptions Class

Definition

Provides programmatic configuration used by IAuthorizationService and IAuthorizationPolicyProvider.

public ref class AuthorizationOptions
public class AuthorizationOptions
type AuthorizationOptions = class
Public Class AuthorizationOptions
Inheritance
AuthorizationOptions

Constructors

AuthorizationOptions()

Properties

DefaultPolicy

Gets or sets the default authorization policy. Defaults to require authenticated users.

FallbackPolicy

Gets or sets the fallback authorization policy used by CombineAsync(IAuthorizationPolicyProvider, IEnumerable<IAuthorizeData>) when no IAuthorizeData have been provided. As a result, the AuthorizationMiddleware uses the fallback policy if there are no IAuthorizeData instances for a resource. If a resource has any IAuthorizeData then they are evaluated instead of the fallback policy. By default the fallback policy is null, and usually will have no effect unless you have the AuthorizationMiddleware in your pipeline. It is not used in any way by the default IAuthorizationService.

InvokeHandlersAfterFailure

Determines whether authorization handlers should be invoked after HasFailed. Defaults to true.

Methods

AddPolicy(String, Action<AuthorizationPolicyBuilder>)

Add a policy that is built from a delegate with the provided name.

AddPolicy(String, AuthorizationPolicy)

Add an authorization policy with the provided name.

GetPolicy(String)

Returns the policy for the specified name, or null if a policy with the name does not exist.

Applies to