Method CreateAsync
CreateAsync(string, string, string?, CancellationToken)
Creates a one-time sign-in code for a user, bound to the specified PKCE code challenge.
Declaration
public Task<string> CreateAsync(string userId, string codeChallenge, string? appData = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | userId | The ID of the user that the code signs in. |
| string | codeChallenge | The client's |
| string | appData | An optional value of the app's that the code carries and that redeeming it returns (see AppData). It is kept in the short-lived store with the code. |
| CancellationToken | cancellationToken | A token to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task<string> |
Exceptions
| Type | Condition |
|---|---|
| BadRequestApiException | The code challenge is malformed (CodeChallengeInvalid). |