Method GetCredentialAsync
GetCredentialAsync(string, CancellationToken)
Gets a passkey credential (a WebAuthn assertion), to sign in or to confirm the signed-in user.
Declaration
public Task<PasskeyCredential> GetCredentialAsync(string requestOptionsJson, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | requestOptionsJson | The request options from the app's API, as WebAuthn JSON ( |
| CancellationToken | cancellationToken | A token to cancel the operation. On WebAssembly, cancellation stops waiting but can't close a prompt the browser is already showing. |
Returns
| Type | Description |
|---|---|
| Task<PasskeyCredential> | The credential to post to the app's API, and whether the passkey was on this device. |
Implements
Exceptions
| Type | Condition |
|---|---|
| PasskeyAuthenticatorException | The operation failed or the person cancelled it. Reason says why. |
| InvalidOperationException | This platform uses the passkey page and PageUri is not set, or the app's callback isn't set up. |
| OperationCanceledException |
|