You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Using Passkeys with Auth0 Class](#using-passkeys-with-auth0-class)
58
59
-[Error Handling](#passkeys-error-handling)
59
60
-[Platform Support](#passkeys-platform-support)
@@ -1025,7 +1026,13 @@ For detailed examples of validating different token types in Actions, see:
1025
1026
1026
1027
### Overview
1027
1028
1028
-
Passkeys provide a passwordless authentication experience using platform biometrics (Face ID, TouchID, fingerprint) backed by public-key cryptography. TheSDK orchestrates the full passkey flow — requesting a challenge from Auth0, presenting the OS passkey UI, and completing authentication — in a single method call.
1029
+
Passkeys provide a passwordless authentication experience using platform biometrics (Face ID, TouchID, fingerprint) backed by public-key cryptography. TheSDK handles the full passkey flow — challenge, platform credential manager interaction, and token exchange — so you can implement passkeys without writing any custom native code.
1030
+
1031
+
The passkey flow has three steps:
1032
+
1033
+
1.**Challenge** — Request a WebAuthn challenge from Auth0 (`passkeySignupChallenge` or `passkeyLoginChallenge`)
1034
+
2.**Credential Manager** — Present the OS credential manager UI to create or assert a passkey (`passkeyRegistration` or `passkeyAssertion`)
1035
+
3.**Exchange** — Send the credential response back to Auth0 to get tokens (`passkeyExchange`)
1029
1036
1030
1037
>**Platform Support:** Native only (iOS 16.6+/ Android). Not supported on Web.
1031
1038
@@ -1040,44 +1047,47 @@ Before using passkeys:
1040
1047
3.**iOS:** Requires iOS 16.6 or later. Add an Associated Domain with the `webcredentials` service pointing to your Auth0 custom domain
1041
1048
4.**Android:** Requires Android API28+. Configure your app's Digital Asset Links for the Auth0 custom domain
1042
1049
1043
-
> **Important:** `signupWithPasskey` creates a **new** user account with a passkey. It will fail if the email already exists in the database connection. Use `signinWithPasskey` for existing users who have already registered a passkey.
1050
+
> **Important:** `passkeySignupChallenge` is for creating **new** user accounts with a passkey. It will fail if the email already exists in the database connection. Use `passkeyLoginChallenge` for existing users who have already registered a passkey.
1044
1051
1045
1052
### Signup with Passkey
1046
1053
1047
-
Register a new passkey for a user and obtain Auth0 credentials:
1054
+
The signup flow requests a registration challenge, presents the OS credential manager UI to create a new passkey, then exchanges the result for Auth0 tokens. The SDK handles the platform credential manager interaction for you.
1048
1055
1049
1056
```tsx
1050
-
import { useAuth0, PasskeyError, PasskeyErrorCodes } from 'react-native-auth0';
1057
+
import { useAuth0, PasskeyError } from 'react-native-auth0';
@@ -1088,17 +1098,32 @@ function PasskeySignupScreen() {
1088
1098
1089
1099
### Signin with Passkey
1090
1100
1091
-
Authenticate with an existing passkey:
1101
+
The login flow requests an assertion challenge, presents the OS credential manager UI to assert an existing passkey, then exchanges the result for Auth0 tokens.
@@ -1125,53 +1141,157 @@ function PasskeySigninScreen() {
1125
1141
}
1126
1142
```
1127
1143
1144
+
### Advanced: Manual Credential Manager Handling
1145
+
1146
+
If you need full control over the platform credential manager interaction (e.g., custom UI, conditional mediation, or hybrid security key support), you can skip `passkeyRegistration`/`passkeyAssertion` and handle it yourself. The challenge and exchange methods give you the raw WebAuthn data:
1147
+
1148
+
```tsx
1149
+
// Step 1: Get challenge (same as above)
1150
+
constchallenge=awaitpasskeySignupChallenge({
1151
+
email:'user@example.com',
1152
+
realm:'...',
1153
+
});
1154
+
1155
+
// Step 2: Use your own native module or library to interact with the credential manager
1156
+
// challenge.authParamsPublicKey contains the raw WebAuthn PublicKeyCredentialCreationOptions
1157
+
// You must serialize the resulting PublicKeyCredential as JSON
The `authResponse` parameter passed to `passkeyExchange` must be a JSON string representing the [PublicKeyCredential](https://www.w3.org/TR/webauthn-2/#publickeycredential) response from the platform credential manager.
0 commit comments