PolicyBuilderExtensions Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Extensions for building the RequiredScope policy during application startup.
public static class PolicyBuilderExtensions
type PolicyBuilderExtensions = class
Public Module PolicyBuilderExtensions
- Inheritance
-
PolicyBuilderExtensions
Examples
services.AddAuthorization(o =>
{ o.AddPolicy("Custom",
policyBuilder =>policyBuilder.RequireScope("access_as_user"));
});
Methods
RequireScope(AuthorizationPolicyBuilder, IEnumerable<String>) |
Adds a ScopeAuthorizationRequirement to the current instance which requires that the current user has the specified claim and that the claim value must be one of the allowed values. |
RequireScope(AuthorizationPolicyBuilder, String[]) |
Adds a ScopeAuthorizationRequirement to the current instance which requires that the current user has the specified claim and that the claim value must be one of the allowed values. |
RequireScopeOrAppPermission(AuthorizationPolicyBuilder, IEnumerable<String>, IEnumerable<String>) |
Adds a ScopeOrAppPermissionAuthorizationRequirement to the current instance which requires that the current user has the specified claim and that the claim value must be one of the allowed values. |