Click or drag to resize

IRhinoAccountsManagerGetAuthTokensAsync Method (String, String, SecretKey, CancellationToken)

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
Task<Tuple<IOpenIDConnectToken, IOAuth2Token>> GetAuthTokensAsync(
	string clientId,
	string clientSecret,
	SecretKey secretKey,
	CancellationToken cancellationToken
)

Parameters

clientId
Type: SystemString
The unique id of the client registered in Rhino Accounts.
clientSecret
Type: SystemString
The secret of the client registered in Rhino Accounts
secretKey
Type: Rhino.Runtime.RhinoAccountsSecretKey
A special key that was handed to you in ExecuteProtectedCodeAsync(FuncSecretKey, Task)
cancellationToken
Type: System.ThreadingCancellationToken
A token that can be used to signal that the operation should be cancelled.

Return Value

Type: TaskTupleIOpenIDConnectToken, IOAuth2Token
The auth tokens requested.
Exceptions
ExceptionCondition
InvalidOperationExceptionAn invalid secretKey was passed, or the assembly is not allowed to call methods from IRhinoAccountsManager
RhinoAccountsExceptionAn 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.
OperationCanceledExceptionThe 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 TryGetAuthTokens(String, SecretKey)
See Also