passkeyLoginChallenge method

Future<WebPasskeyChallenge> passkeyLoginChallenge({
  1. String? connection,
  2. String? organizationId,
})

Requests a WebAuthn assertion challenge for logging in with an existing passkey.

This is the first step of the passkey login flow. Use the returned WebPasskeyChallenge.authParamsPublicKey with the browser's WebAuthn API (navigator.credentials.get()) to assert an existing passkey, then pass the resulting credential to getTokenByPasskey to exchange it for tokens.

Note: navigator.credentials.get() requires a user gesture, so call this from within a click handler (not, for example, from onLoad).

Notes

  • connection is the name of the database connection configured with passkeys.
  • organizationId is the optional Auth0 organization to log in to.

Implementation

Future<WebPasskeyChallenge> passkeyLoginChallenge({
  final String? connection,
  final String? organizationId,
}) =>
    Auth0FlutterWebPlatform.instance.passkeyLoginChallenge(
      WebPasskeyLoginChallengeOptions(
        connection: connection,
        organization: organizationId,
      ),
    );