-
Notifications
You must be signed in to change notification settings - Fork 9
Authorization Service
Ioan Crisan edited this page Oct 16, 2018
·
3 revisions
The authorization service is used to ensure that a certain context has the required authorization.
This is a shared application service contract providing a single method:
AuthorizeAsync(authContext: IAuthorizationContext, cancellationToken: CancellationToken = default): Task<bool>
An authorization context contains:
-
Identity (inherited from the base
IContext): the identity requesting authorization. - RequiredPermissions/RequiredPermissionTypes: the list of permissions to check.
- Scope (optional): a scope object for which the required permissions apply.
-
ThrowOnFailure (default
true): A boolean value indicating whether to throw on authorization failure. If false is indicated, the authorization check will return false upon failure, otherwise an exception will occur.