Skip to content

Commit 6ae1fe1

Browse files
committed
main' into SDK-6103-My-Account-Auth-Methods-Android-Support
2 parents 25b4e13 + 3239d94 commit 6ae1fe1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3655
-185
lines changed

.github/actions/maven-publish/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ runs:
3030

3131
- name: Publish Android/Java Packages to Maven
3232
shell: bash
33-
run: ./gradlew publish -PisSnapshot=false --stacktrace
33+
run: ./gradlew publishToSonatype closeSonatypeStagingRepository -PisSnapshot=false --stacktrace
3434
env:
3535
MAVEN_USERNAME: ${{ inputs.ossr-username }}
3636
MAVEN_PASSWORD: ${{ inputs.ossr-token }}

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ jobs:
3636
run: exit 0 # Skip unnecessary test runs for dependabot and merge queues. Artifically flag as successful, as this is a required check for branch protection.
3737

3838
- name: Set up Java
39-
uses: actions/setup-java@v4
39+
uses: actions/setup-java@v5
4040
with:
4141
distribution: 'temurin'
4242
java-version: '11'
4343

4444
- name: Checkout
45-
uses: actions/checkout@v4
45+
uses: actions/checkout@v5
4646

4747
- name: Initialize CodeQL
4848
uses: github/codeql-action/init@v3

.github/workflows/java-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
steps:
3232
# Checkout the code
33-
- uses: actions/checkout@v4
33+
- uses: actions/checkout@v5
3434
with:
3535
fetch-depth: 0
3636

.github/workflows/rl-scanner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
steps:
3939
- name: Checkout code
40-
uses: actions/checkout@v4
40+
uses: actions/checkout@v5
4141
with:
4242
fetch-depth: 0
4343

.github/workflows/semgrep.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
runs-on: ubuntu-latest
2424

2525
steps:
26-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@v5
2727

2828
- uses: ./.github/actions/setup
2929

3030
- run: ./gradlew clean test jacocoTestReport lint --continue --console=plain --max-workers=1 --no-daemon
3131

32-
- uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # pin@5.4.3
32+
- uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00 # pin@5.5.0

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.9.0
1+
3.9.1

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
# Change Log
22

3-
## [3.9.0](https://github.com/auth0/Auth0.Android/tree/3.9.0) (2025-07-02)
3+
## [3.9.1](https://github.com/auth0/Auth0.Android/tree/3.9.1) (2025-08-12)
4+
[Full Changelog](https://github.com/auth0/Auth0.Android/compare/3.9.0...3.9.1)
5+
6+
**Fixed**
7+
- fix: Fixed the transitive dependency issue on generated aar file [\#858](https://github.com/auth0/Auth0.Android/pull/858) ([pmathew92](https://github.com/pmathew92))
8+
9+
## [3.9.0](https://github.com/auth0/Auth0.Android/tree/3.9.0) (2025-08-11)
410
[Full Changelog](https://github.com/auth0/Auth0.Android/compare/3.8.0...3.9.0)
511

612
**Added**
13+
- feat: Add support for DPoP [\#850](https://github.com/auth0/Auth0.Android/pull/850) ([pmathew92](https://github.com/pmathew92))
714
- feat : support to pass organisation while signing-up and signing-in with passkeys [\#843](https://github.com/auth0/Auth0.Android/pull/843) ([pmathew92](https://github.com/pmathew92))
815
- Exposes UserProfile to return contents of id token without refreshing credentials [\#840](https://github.com/auth0/Auth0.Android/pull/840) ([NandanPrabhu](https://github.com/NandanPrabhu))
916

17+
**Updated**
18+
- `userInfo` api in the `AuthenticationAPIClient` class now takes a tokenType parameter with a default value of `Bearer`.
19+
1020
## [3.8.0](https://github.com/auth0/Auth0.Android/tree/3.8.0) (2025-06-04)
1121
[Full Changelog](https://github.com/auth0/Auth0.Android/compare/3.7.0...3.8.0)
1222

EXAMPLES.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- [Changing the Return To URL scheme](#changing-the-return-to-url-scheme)
1212
- [Specify a Custom Logout URL](#specify-a-custom-logout-url)
1313
- [Trusted Web Activity](#trusted-web-activity)
14+
- [DPoP [EA]](#dpop-ea)
1415
- [Authentication API](#authentication-api)
1516
- [Login with database connection](#login-with-database-connection)
1617
- [Login using MFA with One Time Password code](#login-using-mfa-with-one-time-password-code)
@@ -21,6 +22,7 @@
2122
- [Get user information](#get-user-information)
2223
- [Custom Token Exchange](#custom-token-exchange)
2324
- [Native to Web SSO login [EA]](#native-to-web-sso-login-ea)
25+
- [DPoP [EA]](#dpop-ea-1)
2426
- [My Account API](#my-account-api)
2527
- [Enroll a new passkey](#enroll-a-new-passkey)
2628
- [Credentials Manager](#credentials-manager)
@@ -208,6 +210,76 @@ WebAuthProvider.login(account)
208210
.await(this)
209211
```
210212

213+
## DPoP [EA]
214+
215+
> [!NOTE]
216+
> 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.
217+
218+
[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()` method.
219+
220+
```kotlin
221+
WebAuthProvider
222+
.useDPoP()
223+
.login(account)
224+
.start(requireContext(), object : Callback<Credentials, AuthenticationException> {
225+
override fun onSuccess(result: Credentials) {
226+
println("Credentials $result")
227+
}
228+
override fun onFailure(error: AuthenticationException) {
229+
print("Error $error")
230+
}
231+
})
232+
```
233+
234+
> [!IMPORTANT]
235+
> DPoP will only be used for new user sessions created after enabling it. DPoP **will not** be applied to any requests involving existing access and refresh tokens (such as exchanging the refresh token for new credentials).
236+
>
237+
> This means that, after you've enabled it in your app, DPoP will only take effect when users log in again. It's up to you to decide how to roll out this change to your users. For example, you might require users to log in again the next time they open your app. You'll need to implement the logic to handle this transition based on your app's requirements.
238+
239+
When making requests to your own APIs, use the `DPoP.getHeaderData()` method to get the `Authorization` and `DPoP` header values to be used. The `Authorization` header value is generated using the access token and token type, while the `DPoP` header value is the generated DPoP proof.
240+
241+
```kotlin
242+
val url ="https://example.com/api/endpoint"
243+
val httpMethod = "GET"
244+
val headerData = DPoP.getHeaderData(
245+
httpMethod, url,
246+
accessToken, tokenType
247+
)
248+
httpRequest.apply{
249+
addHeader("Authorization", headerData.authorizationHeader)
250+
headerData.dpopProof?.let {
251+
addHeader("DPoP", it)
252+
}
253+
}
254+
```
255+
If your API is issuing DPoP nonces to prevent replay attacks, you can pass the nonce value to the `getHeaderData()` method to include it in the DPoP proof. Use the `DPoP.isNonceRequiredError(response: Response)` method to check if a particular API response failed because a nonce is required.
256+
257+
```kotlin
258+
if (DPoP.isNonceRequiredError(response)) {
259+
val nonce = response.headers["DPoP-Nonce"]
260+
val dpopProof = DPoPProvider.generateProof(
261+
url, httpMethod, accessToken, nonce
262+
)
263+
// Retry the request with the new proof
264+
}
265+
```
266+
267+
On logout, you should call `DPoP.clearKeyPair()` to delete the user's key pair from the Keychain.
268+
269+
```kotlin
270+
WebAuthProvider.logout(account)
271+
.start(requireContext(), object : Callback<Void?, AuthenticationException> {
272+
override fun onSuccess(result: Void?) {
273+
DPoPProvider.clearKeyPair()
274+
}
275+
override fun onFailure(error: AuthenticationException) {
276+
}
277+
278+
})
279+
```
280+
> [!NOTE]
281+
> 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.
282+
211283
## Authentication API
212284

213285
The client provides methods to authenticate the user against the Auth0 server.
@@ -651,6 +723,62 @@ authentication
651723
```
652724
</details>
653725

726+
## DPoP [EA]
727+
728+
> [!NOTE]
729+
> 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.
730+
731+
[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.
732+
733+
```kotlin
734+
val client = AuthenticationAPIClient(account).useDPoP()
735+
```
736+
737+
[!IMPORTANT]
738+
> DPoP will only be used for new user sessions created after enabling it. DPoP **will not** be applied to any requests involving existing access and refresh tokens (such as exchanging the refresh token for new credentials).
739+
>
740+
> This means that, after you've enabled it in your app, DPoP will only take effect when users log in again. It's up to you to decide how to roll out this change to your users. For example, you might require users to log in again the next time they open your app. You'll need to implement the logic to handle this transition based on your app's requirements.
741+
742+
When making requests to your own APIs, use the `DPoP.getHeaderData()` method to get the `Authorization` and `DPoP` header values to be used. The `Authorization` header value is generated using the access token and token type, while the `DPoP` header value is the generated DPoP proof.
743+
744+
```kotlin
745+
val url ="https://example.com/api/endpoint"
746+
val httpMethod = "GET"
747+
val headerData = DPoP.getHeaderData(
748+
httpMethod, url,
749+
accessToken, tokenType
750+
)
751+
httpRequest.apply{
752+
addHeader("Authorization", headerData.authorizationHeader)
753+
headerData.dpopProof?.let {
754+
addHeader("DPoP", it)
755+
}
756+
}
757+
```
758+
If your API is issuing DPoP nonces to prevent replay attacks, you can pass the nonce value to the `getHeaderData()` method to include it in the DPoP proof. Use the `DPoP.isNonceRequiredError(response: Response)` method to check if a particular API response failed because a nonce is required.
759+
760+
```kotlin
761+
if (DPoP.isNonceRequiredError(response)) {
762+
val nonce = response.headers["DPoP-Nonce"]
763+
val dpopProof = DPoPProvider.generateProof(
764+
url, httpMethod, accessToken, nonce
765+
)
766+
// Retry the request with the new proof
767+
}
768+
```
769+
770+
On logout, you should call `DPoP.clearKeyPair()` to delete the user's key pair from the Keychain.
771+
772+
```kotlin
773+
774+
DPoP.clearKeyPair()
775+
776+
```
777+
778+
> [!NOTE]
779+
> 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.
780+
781+
654782

655783
## My Account API
656784

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ To install Auth0.Android with [Gradle](https://gradle.org/), simply add the foll
5151

5252
```gradle
5353
dependencies {
54-
implementation 'com.auth0.android:auth0:3.9.0'
54+
implementation 'com.auth0.android:auth0:3.9.1'
5555
}
5656
```
5757

0 commit comments

Comments
 (0)