Method SignInWithCodeAsync
SignInWithCodeAsync(bool, CancellationToken)
Asynchronously attempts to sign in using the previously generated sign-in code. This method can optionally poll the server for sign-in confirmation.
Declaration
Task SignInWithCodeAsync(bool usePolling = false, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | usePolling | If set to true, the method will continuously poll the server to check if the code has been confirmed, until either the device signs in successfully, the code expires, or the CancellationToken is triggered. False by default. |
| CancellationToken | cancellationToken | A token used to cancel the ongoing operation, especially useful when polling is enabled. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |
Exceptions
| Type | Condition |
|---|---|
| AuthenticationException | Thrown when the current authentication state is invalid for this operation. |
| RequestFailedException | Thrown when there's an issue with the network request. |