Method BeginSignInAsync
BeginSignInAsync(string?, string?, CancellationToken)
Starts a sign-in.
Declaration
public Task<PasskeyCeremony> BeginSignInAsync(string? codeChallenge, string? userId = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | codeChallenge | The client's PKCE code challenge (S256, base64url) to bind the sign-in to, so that it can only be finished with the matching code verifier. Required unless RequireCodeChallenge is false. The verified passkey carries it as CodeChallenge, so the sign-in can continue with a sign-in code bound to the same challenge. |
| string | userId | The user to sign in, if known (for example from an email address they entered), which limits the sign-in to their passkeys. If null, the browser offers all the passkeys for the relying party it can find (discoverable credentials). |
| CancellationToken | cancellationToken | A token to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task<PasskeyCeremony> |
Remarks
A sign-in begun for a user tells the caller whether the user has passkeys: the options list the credential IDs of the user's passkeys, and a user without passkeys is refused. With a user found by an identifier such as an email address, it also tells whether an account has that identifier. A sign-in begun without a user tells nothing about any account.
Exceptions
| Type | Condition |
|---|---|
| BadRequestApiException | The code challenge is malformed, or missing while it is required (CodeChallengeInvalid). |
| UnauthorizedApiException | The user has no passkeys (NoPasskeys). |