passkeySignupChallenge method
Requests a WebAuthn registration challenge for signing up a new user with a passkey.
This is the first step of the passkey signup flow. Use the returned
WebPasskeyChallenge.authParamsPublicKey with the browser's
WebAuthn API
(navigator.credentials.create()) to create a new passkey credential,
then pass the resulting credential to getTokenByPasskey to exchange it
for tokens.
Note: navigator.credentials.create() requires a user gesture, so
call this from within a click handler (not, for example, from onLoad).
Notes
- Identify the new user with any combination of
email,phoneNumber,username,name,givenName,familyName,nickname, andpicture, depending on how your connection is configured. connectionis the name of the database connection configured with passkeys.organizationIdis the optional Auth0 organization to sign up to.userMetadatais optional metadata to associate with the new user.deliveryMethodselects how a phone one-time code is delivered when the connection requires phone identifier verification. It is ignored when only an email is verified. Defaults to the connection's setting.
Identifier verification
When identifier verification is enabled for the connection,
WebPasskeyChallenge.verificationRequired lists the identifiers to
verify. Collect a one-time code for each of them before calling
navigator.credentials.create(), then pass the codes as verification
to getTokenByPasskey.
Implementation
Future<WebPasskeyChallenge> passkeySignupChallenge({
final String? email,
final String? phoneNumber,
final String? username,
final String? name,
final String? givenName,
final String? familyName,
final String? nickname,
final String? picture,
final String? connection,
final String? organizationId,
final Map<String, String>? userMetadata,
final DeliveryMethod? deliveryMethod,
}) =>
Auth0FlutterWebPlatform.instance.passkeySignupChallenge(
WebPasskeySignupChallengeOptions(
email: email,
phoneNumber: phoneNumber,
username: username,
name: name,
givenName: givenName,
familyName: familyName,
nickname: nickname,
picture: picture,
connection: connection,
organization: organizationId,
userMetadata: userMetadata,
deliveryMethod: deliveryMethod,
),
);