Skip to content

RhinoAccountsManager.UpdateOpenIDConnectTokenAsync

Public Class

Updates an OpenID Connect token so that it contains the latest user information by contacting the Rhino Account’s server userinfo endpoint using a compatible O

Namespace: Rhino.Runtime.RhinoAccounts

Assembly: RhinoCommon (in RhinoCommon.dll)

**Since:**7.0

Syntax

public static Task<IOpenIDConnectToken> UpdateOpenIDConnectTokenAsync(
IOpenIDConnectToken currentToken,
IOAuth2Token oauth2Token,
SecretKey secretKey,
CancellationToken cancellationToken
)

Parameters

currentToken

Type: Rhino.Runtime.RhinoAccounts.IOpenIDConnectToken
The existing OpenID Connect token that you wish to updated with the latest user information.

oauth2Token

Type: Rhino.Runtime.RhinoAccounts.IOAuth2Token
A valid OAuth2 token used for authorization. The OAuth2 token must have been issued together with the OpenID Connect token passed or a RhinoAccountsAuthTokenMismatchException will be thrown.

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. IOpenIDConnectToken.
The updated OpenIDConnectToken based on the original token passed to this method.

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

If the OpenID Connect token is currently stored in the local cache, it will be updated to reflect the new token.