passkeySignupChallenge method

Future<WebPasskeyChallenge> passkeySignupChallenge({
  1. String? email,
  2. String? phoneNumber,
  3. String? username,
  4. String? name,
  5. String? givenName,
  6. String? familyName,
  7. String? nickname,
  8. String? picture,
  9. String? connection,
  10. String? organizationId,
  11. Map<String, String>? userMetadata,
})

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, and picture, depending on how your connection is configured.
  • connection is the name of the database connection configured with passkeys.
  • organizationId is the optional Auth0 organization to sign up to.
  • userMetadata is 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,
      ),
    );