Skip to content

RhinoAccountsManager.GetAuthTokensAsync (String, String, SecretKey, CancellationToken)

Public Class

Asynchronously retrieves auth tokens with the given criteria from the Rhino Accounts server.

Namespace: Rhino.Runtime.RhinoAccounts

Assembly: RhinoCommon (in RhinoCommon.dll)

**Since:**7.0

Syntax

public static Task<Tuple<IOpenIDConnectToken, IOAuth2Token>> GetAuthTokensAsync(
string clientId,
string clientSecret,
SecretKey secretKey,
CancellationToken cancellationToken
)

Parameters

clientId

Type:System.String
The unique id of the client registered in Rhino Accounts.

clientSecret

Type:System.String
The secret of the client registered in Rhino Accounts

secretKey

Type: Rhino.Runtime.RhinoAccounts.SecretKey
A special key that was handed to you in ExecuteProtectedCodeAsync(Func.SecretKey, Task.)

cancellationToken

Type:System.Threading.CancellationToken
A token that can be used to signal that the operation should be cancelled.

Return Value

Type:Task.Tuple. IOpenIDConnectToken, IOAuth2Token..
The auth tokens requested.

Exceptions

Exception

Condition


InvalidOperationException

An invalid secretKey was passed, or the assembly is not allowed to call methods from IRhinoAccountsManager


RhinoAccountsException

An error occurred during the authentication process. You may look at the specific subclass of the exception gain more insight as to why the operation failed.


OperationCanceledException

The operation was cancelled, either by internal decisions or because the cancellationToken was cancelled.


Remarks

This method includes a default scope of ‘openid’, ‘email’, ‘profile’, and ‘groups’. It should be suffifient for most workflows. This method shows the user a UI showing them the progress of the operation, and allows them to cancel it at any time. It also stores the retrieved tokens in a secure cache so they can be retrieved in the future by calling