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
Copy file name to clipboardExpand all lines: EXAMPLES.md
+36-61Lines changed: 36 additions & 61 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1026,12 +1026,12 @@ For detailed examples of validating different token types in Actions, see:
1026
1026
1027
1027
### Overview
1028
1028
1029
-
Passkeys provide a passwordless authentication experience using platform biometrics (Face ID, TouchID, fingerprint) backed by public-key cryptography. TheSDKhandles the full passkey flow — challenge, platform credential manager interaction, and token exchange — so you can implement passkeys without writing any custom native code.
1029
+
Passkeys provide a passwordless authentication experience using platform biometrics (Face ID, TouchID, fingerprint) backed by public-key cryptography. TheSDKprovides the Auth0 challengeand token exchange steps, while you handle the platform credential manager interaction using native modules or libraries like `react-native-passkey`.
1030
1030
1031
1031
The passkey flow has three steps:
1032
1032
1033
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`)
1034
+
2.**Credential Manager** — Present the OS credential manager UI to create or assert a passkey (using your own native moduleor a library)
1035
1035
3.**Exchange** — Send the credential response back to Auth0 to get tokens (`passkeyExchange`)
1036
1036
1037
1037
>**Platform Support:** Native only (iOS 16.6+/ Android). Not supported on Web.
@@ -1051,14 +1051,13 @@ Before using passkeys:
1051
1051
1052
1052
### Signup with Passkey
1053
1053
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.
1054
+
The signup flow requests a registration challenge from Auth0, then you use the platform credential manager (via a native module or library like `react-native-passkey`) to create a new passkey, and finally exchange the credential for Auth0 tokens.
1055
1055
1056
1056
```tsx
1057
1057
import { useAuth0, PasskeyError } from 'react-native-auth0';
// Step 3: Exchange the credential response for Auth0 tokens
1079
1079
const credentials = await passkeyExchange({
@@ -1098,14 +1098,13 @@ function PasskeySignupScreen() {
1098
1098
1099
1099
### Signin with Passkey
1100
1100
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.
1101
+
The login flow requests an assertion challenge from Auth0, then you use the platform credential manager to assert an existing passkey, and finally exchange the credential for Auth0 tokens.
// Step 3: Exchange the credential response for Auth0 tokens
1124
1124
constcredentials=awaitpasskeyExchange({
@@ -1141,33 +1141,6 @@ function PasskeySigninScreen() {
1141
1141
}
1142
1142
```
1143
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