Class AuthorizeForScopesAttribute
Filter used on a controller action to trigger incremental consent.
public class AuthorizeForScopesAttribute : ExceptionFilterAttribute, IAsyncExceptionFilter, IExceptionFilter, IOrderedFilter, IFilterMetadata
- Inheritance
-
AuthorizeForScopesAttribute
- Implements
- Inherited Members
Examples
The following controller action will trigger.
[AuthorizeForScopes(Scopes = new[] {"Mail.Send"})]
public async Task<IActionResult> SendEmail()
{
}
Constructors
AuthorizeForScopesAttribute()
public AuthorizeForScopesAttribute()
Properties
AuthenticationScheme
Allows specifying an AuthenticationScheme if OpenIdConnect is not the default challenge scheme.
public string? AuthenticationScheme { get; set; }
Property Value
ScopeKeySection
Key section on the configuration file that holds the scope value.
public string? ScopeKeySection { get; set; }
Property Value
Scopes
Scopes to request.
public string[]? Scopes { get; set; }
Property Value
- string[]
UserFlow
Azure AD B2C user flow.
public string? UserFlow { get; set; }
Property Value
Methods
OnException(ExceptionContext)
Handles the Microsoft.Identity.Client.MsalUiRequiredException.
public override void OnException(ExceptionContext context)
Parameters
context
ExceptionContextContext provided by ASP.NET Core.