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
> 💡 You might want to log the user in after signup. See [Login with database connection](#login-with-database-connection) above for an example.
1106
+
1093
1107
### Log in with passkeys
1094
1108
1095
1109
> This feature is available on **iOS 16.6+** and **Android 9+ (API 28)** only.
@@ -1101,33 +1115,33 @@ final credentials = await auth0.api.login(
1101
1115
> - Enable passkeys for your database connection and the **Passkey** grant type for your application. See [Configure passkeys](https://auth0.com/docs/authenticate/database-connections/passkeys/configure-passkeys).
1102
1116
> - Configure the [associated domain (iOS/macOS)](README.md#iosmacos-configure-the-associated-domain) and the equivalent [Digital Asset Links file](https://developer.android.com/identity/sign-in/credential-manager#add-support-dal) (Android) so the OS associates your app with the relying-party domain.
1103
1117
1104
-
The SDK exposes **two** methods for passkey login — `passkeyLoginChallenge` and `passkeyLogin` — and leaves presenting the OS passkey UI to your app. The flow is:
1118
+
The SDK exposes **two** methods for passkey login — `passkeyLoginChallenge` and `passkeyCredentialExchange` — and leaves presenting the OS passkey UI to your app. The flow is:
1105
1119
1106
1120
1. Request a login challenge from Auth0 with `passkeyLoginChallenge`.
1107
-
2.**In your app**, present the platform authenticator using that challenge and obtain a WebAuthn assertion. The SDK does **not** do this step — call the OS APIs directly (for example, [`ASAuthorizationController`](https://developer.apple.com/documentation/authenticationservices/asauthorizationcontroller) on iOS/macOS or [Credential Manager](https://developer.android.com/identity/sign-in/credential-manager) on Android, typically over your own platform channel), then map the result into a `PasskeyLoginCredential`.
1108
-
3. Exchange that credential for Auth0 tokens with `passkeyLogin`.
1121
+
2.**In your app**, present the platform authenticator using that challenge and obtain a WebAuthn assertion. The SDK does **not** do this step — call the OS APIs directly (for example, [`ASAuthorizationController`](https://developer.apple.com/documentation/authenticationservices/asauthorizationcontroller) on iOS/macOS or [Credential Manager](https://developer.android.com/identity/sign-in/credential-manager) on Android, typically over your own platform channel), then map the result into a `PasskeyCredential`.
1122
+
3. Exchange that credential for Auth0 tokens with `passkeyCredentialExchange`.
1109
1123
1110
1124
```dart
1111
1125
// 1. Request a login challenge from Auth0.
1112
1126
final challenge = await auth0.api.passkeyLoginChallenge(
1113
1127
connection: 'Username-Password-Authentication');
1114
1128
1115
1129
// 2. Present the OS passkey UI in your app (not provided by the SDK) using
1116
-
// `challenge.authParamsPublicKey`, then build a PasskeyLoginCredential from
1117
-
// the resulting WebAuthn assertion. All values are base64url-encoded.
1118
-
final credential = PasskeyLoginCredential(
1130
+
// `challenge.authParamsPublicKey`, then build a PasskeyCredential from the
1131
+
// resulting WebAuthn assertion. All values are base64url-encoded.
final credentials = await auth0.api.passkeyCredentialExchange(
1131
1145
challenge: challenge,
1132
1146
credential: credential,
1133
1147
connection: 'Username-Password-Authentication');
@@ -1141,7 +1155,7 @@ final didStore =
1141
1155
<summary>Add an audience and scope values</summary>
1142
1156
1143
1157
```dart
1144
-
final credentials = await auth0.api.passkeyLogin(
1158
+
final credentials = await auth0.api.passkeyCredentialExchange(
1145
1159
challenge: challenge,
1146
1160
credential: credential,
1147
1161
connection: 'Username-Password-Authentication',
@@ -1151,17 +1165,72 @@ final credentials = await auth0.api.passkeyLogin(
1151
1165
1152
1166
</details>
1153
1167
1154
-
### Sign up with database connection
1168
+
### Sign up with passkeys
1169
+
1170
+
> This feature is available on **iOS 16.6+** and **Android 9+ (API 28)** only.
1171
+
1172
+
[Passkeys](https://auth0.com/docs/authenticate/database-connections/passkeys) let users register with a biometric or device PIN instead of a password, using the platform authenticator (Face ID / Touch ID on iOS, the Credential Manager on Android).
1173
+
1174
+
> ⚠️ Passkeys require additional configuration on both your Auth0 tenant and your app:
1175
+
> - Set up a [custom domain](https://auth0.com/docs/customize/custom-domains) for your tenant. Passkeys will **not** work without one, since the relying-party domain must be a domain you own and can host the associated domain / Digital Asset Links file on.
1176
+
> - Enable passkeys for your database connection and the **Passkey** grant type for your application. See [Configure passkeys](https://auth0.com/docs/authenticate/database-connections/passkeys/configure-passkeys).
1177
+
> - Configure the [associated domain (iOS/macOS)](README.md#iosmacos-configure-the-associated-domain) and the equivalent [Digital Asset Links file](https://developer.android.com/identity/sign-in/credential-manager#add-support-dal) (Android) so the OS associates your app with the relying-party domain.
1178
+
1179
+
The SDK exposes **two** methods for passkey signup — `passkeySignupChallenge` and `passkeyCredentialExchange` — and leaves presenting the OS passkey UI to your app. The flow is:
1180
+
1181
+
1. Request a registration challenge from Auth0 with `passkeySignupChallenge`.
1182
+
2.**In your app**, present the platform authenticator using that challenge and obtain a WebAuthn attestation. The SDK does **not** do this step — call the OS APIs directly (for example, [`ASAuthorizationController`](https://developer.apple.com/documentation/authenticationservices/asauthorizationcontroller) on iOS/macOS or [Credential Manager](https://developer.android.com/identity/sign-in/credential-manager) on Android, typically over your own platform channel), then map the result into a `PasskeyCredential`.
1183
+
3. Exchange that credential for Auth0 tokens with `passkeyCredentialExchange` — the same method used for login.
1184
+
1185
+
You can identify the new user with any combination of `email`, `phoneNumber`, `username`, `name`, `givenName`, `familyName`, `nickname`, and `picture`, depending on how your connection is configured.
1155
1186
1156
1187
```dart
1157
-
final databaseUser = await auth0.api.signup(
1188
+
// 1. Request a registration challenge from Auth0. You can identify the new
1189
+
// user with any combination of email, phoneNumber, username, name,
1190
+
// givenName, familyName, nickname, and picture.
1191
+
final challenge = await auth0.api.passkeySignupChallenge(
1158
1192
email: 'jane.smith@example.com',
1159
-
password: 'secret-password',
1193
+
name: 'Jane Smith',
1194
+
givenName: 'Jane',
1195
+
familyName: 'Smith',
1196
+
connection: 'Username-Password-Authentication');
1197
+
1198
+
// 2. Present the OS passkey-creation UI in your app (not provided by the SDK)
1199
+
// using `challenge.authParamsPublicKey`, then build a PasskeyCredential from
1200
+
// the resulting WebAuthn attestation. All values are base64url-encoded.
> 💡 You might want to log the user in after signup. See [Login with database connection](#login-with-database-connection) above for an example.
1233
+
</details>
1165
1234
1166
1235
### Passwordless Login
1167
1236
Passwordless is a two-step authentication flow that requires the **Passwordless OTP** grant to be enabled for your Auth0 application. Check [our documentation](https://auth0.com/docs/get-started/applications/application-grant-types) for more information.
Copy file name to clipboardExpand all lines: auth0_flutter/README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -587,6 +587,7 @@ void dispose() {
587
587
-[Retrieve stored credentials](EXAMPLES.md#retrieve-stored-credentials) - fetch the user's credentials from the storage, automatically renewing them if they have expired.
588
588
-[Retrieve user information](EXAMPLES.md#retrieve-user-information) - fetch the latest user information from the `/userinfo` endpoint.
589
589
-[Log in with passkeys](EXAMPLES.md#log-in-with-passkeys) - authenticate an existing user with a passkey using the platform authenticator (iOS/Android only).
590
+
-[Sign up with passkeys](EXAMPLES.md#sign-up-with-passkeys) - register a new user with a passkey using the platform authenticator (iOS/Android only).
590
591
-[Native to Web SSO](EXAMPLES.md#native-to-web-sso) - obtain a session transfer token to authenticate a WebView without re-prompting the user.
591
592
-[Handle Android process death](#android-handle-process-death-during-login) - recover credentials when the OS kills your app during login.
Copy file name to clipboardExpand all lines: auth0_flutter/android/src/main/kotlin/com/auth0/auth0_flutter/request_handlers/api/PasskeyCredentialExchangeApiRequestHandler.kt
0 commit comments