AuthorizationServiceClient.AuthorizeOrThrowAsync Method
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.
Verifies that the previously authenticated user is authorized to perform some operation, or throws an exception.
public System.Threading.Tasks.Task AuthorizeOrThrowAsync (Microsoft.ServiceHub.Framework.Services.ProtectedOperation operation, System.Threading.CancellationToken cancellationToken = default);
member this.AuthorizeOrThrowAsync : Microsoft.ServiceHub.Framework.Services.ProtectedOperation * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function AuthorizeOrThrowAsync (operation As ProtectedOperation, Optional cancellationToken As CancellationToken = Nothing) As Task
Parameters
- operation
- ProtectedOperation
The operation to check authorization for.
- cancellationToken
- CancellationToken
A cancellation token.
Returns
A task that completes successfully if the operation is authorized, or faults if not.
Exceptions
Thrown if the client is not authorized to perform the operation
.