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
+78-2Lines changed: 78 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -738,10 +738,10 @@ authentication
738
738
> [!NOTE]
739
739
> This feature is currently available in [Early Access](https://auth0.com/docs/troubleshoot/product-lifecycle/product-release-stages#early-access). Please reach out to Auth0 support to get it enabled for your tenant.
740
740
741
-
[DPoP](https://www.rfc-editor.org/rfc/rfc9449.html) (Demonstrating Proof of Posession) is an application-level mechanism for sender-constraining OAuth 2.0 access and refresh tokens by proving that the app is in possession of a certain private key. You can enable it by calling the `useDPoP()` method. This ensures that DPoP proofs are generated for requests made through the AuthenticationAPI client.
741
+
[DPoP](https://www.rfc-editor.org/rfc/rfc9449.html) (Demonstrating Proof of Possession) is an application-level mechanism for sender-constraining OAuth 2.0 access and refresh tokens by proving that the app is in possession of a certain private key. You can enable it by calling the `useDPoP(context: Context)` method. This ensures that DPoP proofs are generated for requests made through the AuthenticationAPI client.
742
742
743
743
```kotlin
744
-
val client =AuthenticationAPIClient(account).useDPoP()
744
+
val client =AuthenticationAPIClient(account).useDPoP(context)
745
745
```
746
746
747
747
[!IMPORTANT]
@@ -785,6 +785,17 @@ DPoP.clearKeyPair()
785
785
786
786
```
787
787
788
+
To use DPoP with `SecureCredentialsManager` you need to pass an instance of the `AuthenticationAPIClient` with DPoP enabled to the `SecureCredentialsManager` constructor.
789
+
790
+
```kotlin
791
+
val auth0 =Auth0.getInstance("YOUR_CLIENT_ID", "YOUR_DOMAIN")
792
+
val apiClient =AuthenticationAPIClient(auth0).useDPoP(this)
793
+
val storage =SharedPreferencesStorage(this)
794
+
val manager =SecureCredentialsManager(apiClient, this, auth0, storage)
795
+
796
+
```
797
+
798
+
788
799
> [!NOTE]
789
800
> DPoP is supported only on Android version 6.0 (API level 23) and above. Trying to use DPoP in any older versions will result in an exception.
790
801
@@ -1382,6 +1393,28 @@ SecureCredentialsManager manager = new SecureCredentialsManager(this, account, s
1382
1393
```
1383
1394
</details>
1384
1395
1396
+
#### Using a Custom AuthenticationAPIClient
1397
+
1398
+
If you need to configure the `AuthenticationAPIClient` with advanced features (such as DPoP), you can pass your own configured instance to `SecureCredentialsManager`:
1399
+
1400
+
```kotlin
1401
+
val auth0 =Auth0.getInstance("YOUR_CLIENT_ID", "YOUR_DOMAIN")
1402
+
val apiClient =AuthenticationAPIClient(auth0).useDPoP(this)
1403
+
val storage =SharedPreferencesStorage(this)
1404
+
val manager =SecureCredentialsManager(apiClient, this, auth0, storage)
You can require the user authentication to obtain credentials. This will make the manager prompt the user with the device's configured Lock Screen, which they must pass correctly in order to obtain the credentials. **This feature is only available on devices where the user has setup a secured Lock Screen** (PIN, Pattern, Password or Fingerprint).
@@ -1419,6 +1452,49 @@ SecureCredentialsManager secureCredentialsManager = new SecureCredentialsManager
1419
1452
```
1420
1453
</details>
1421
1454
1455
+
You can also combine biometric authentication with a custom `AuthenticationAPIClient`:
1456
+
1457
+
```kotlin
1458
+
val auth0 =Auth0.getInstance("YOUR_CLIENT_ID", "YOUR_DOMAIN")
1459
+
val apiClient =AuthenticationAPIClient(auth0).useDPoP(this)
0 commit comments