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.
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,
}) =>
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,
),
);