Skip to main content

DefaultParallelModelAuthentication.GetScopesAsync method

Retrieves the available OAuth scopes from the authentication API.

public Task<IReadOnlyList<ScopeModel>> GetScopesAsync(CancellationToken cancellationToken = default)
parameterdescription
cancellationTokenA token that can be used to cancel the operation.

Return Value​

A task that represents the asynchronous operation and returns a read-only list of valid scopes, deduplicated by trimmed name.

Exceptions​

exceptioncondition
ParallelModelResponseDecodeExceptionThe response is malformed, contains an invalid scope, or contains no valid scopes.
ParallelModelAuthenticationExceptionThe authentication API returns an unsuccessful HTTP response after applicable retries.
ParallelModelTransportExceptionAn authentication transport failure cannot be recovered.
OperationCanceledExceptionThe operation is cancelled or its configured timeout expires.

Remarks​

Accepts either a JSON array or an object containing a scopes array. Scope names are compared using ordinal comparison.

See Also​