DefaultParallelModelAuthentication.GetScopesAsync method
Retrieves the available OAuth scopes from the authentication API.
public Task<IReadOnlyList<ScopeModel>> GetScopesAsync(CancellationToken cancellationToken = default)
| parameter | description |
|---|---|
| cancellationToken | A 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
| exception | condition |
|---|---|
| ParallelModelResponseDecodeException | The response is malformed, contains an invalid scope, or contains no valid scopes. |
| ParallelModelAuthenticationException | The authentication API returns an unsuccessful HTTP response after applicable retries. |
| ParallelModelTransportException | An authentication transport failure cannot be recovered. |
| OperationCanceledException | The 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
- class ScopeModel
- class DefaultParallelModelAuthentication
- namespace ParallelModel.Sdk.Authentication