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: V4_MIGRATION_GUIDE.md
+37-16Lines changed: 37 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,9 @@
2
2
3
3
## Overview
4
4
5
-
v4 of the Auth0 Android SDK includes significant build toolchain updates to support the latest Android development environment. This guide documents the changes required when migrating from v3 to v4.
5
+
v4 of the Auth0 Android SDK includes significant build toolchain updates to support the latest
6
+
Android development environment. This guide documents the changes required when migrating from v3 to
7
+
v4.
6
8
7
9
## Requirements Changes
8
10
@@ -50,7 +52,8 @@ buildscript {
50
52
51
53
### Kotlin Version
52
54
53
-
v4 uses **Kotlin 2.0.21**. If you're using Kotlin in your project, you may need to update your Kotlin version to ensure compatibility.
55
+
v4 uses **Kotlin 2.0.21**. If you're using Kotlin in your project, you may need to update your
56
+
Kotlin version to ensure compatibility.
54
57
55
58
```groovy
56
59
buildscript {
@@ -62,14 +65,20 @@ buildscript {
62
65
63
66
### Classes Removed
64
67
65
-
- The `com.auth0.android.provider.PasskeyAuthProvider` class has been removed. Use the APIs from the [AuthenticationAPIClient](auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.kt) class for passkey operations:
66
-
-[passkeyChallenge()](auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.kt#L366-L387) - Request a challenge to initiate passkey login flow
67
-
-[signinWithPasskey()](auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.kt#L235-L253) - Sign in a user using passkeys
68
-
-[signupWithPasskey()](auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.kt#L319-L344) - Sign up a user and returns a challenge for key generation
68
+
- The `com.auth0.android.provider.PasskeyAuthProvider` class has been removed. Use the APIs from
69
+
the [AuthenticationAPIClient](auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.kt)
Sign up a user and returns a challenge for key generation
69
77
70
78
### DPoP Configuration Moved to Builder
71
79
72
-
The `useDPoP()` method has been moved from the `WebAuthProvider` object to the login `Builder` class. This change allows DPoP to be configured per-request instead of globally.
80
+
The `useDPoP(context: Context)` method has been moved from the `WebAuthProvider` object to the login
81
+
`Builder` class. This change allows DPoP to be configured per-request instead of globally.
73
82
74
83
**v3 (global configuration — no longer supported):**
75
84
@@ -87,21 +96,28 @@ WebAuthProvider
87
96
// ✅ Use this instead
88
97
WebAuthProvider
89
98
.login(account)
90
-
.useDPoP(context)
99
+
.useDPoP(context)
91
100
.start(context, callback)
92
101
```
93
102
94
-
This change ensures that DPoP configuration is scoped to individual login requests rather than persisting across the entire application lifecycle.
103
+
This change ensures that DPoP configuration is scoped to individual login requests rather than
104
+
persisting across the entire application lifecycle.
v4 updates the internal Gson dependency from **2.8.9** to **2.11.0**. While the SDK does not expose Gson types in its public API, Gson is included as a transitive runtime dependency. If your app also uses Gson, be aware of the following changes introduced in Gson 2.10+:
110
+
v4 updates the internal Gson dependency from **2.8.9** to **2.11.0**. While the SDK does not expose
111
+
Gson types in its public API, Gson is included as a transitive runtime dependency. If your app also
112
+
uses Gson, be aware of the following changes introduced in Gson 2.10+:
101
113
102
-
-**`TypeToken` with unresolved type variables is rejected at runtime.** Code like `object : TypeToken<List<T>>() {}` (where `T` is a generic parameter) will throw `IllegalArgumentException`. Use Kotlin `reified` type parameters or pass concrete types instead.
103
-
-**Strict type coercion is enforced.** Gson no longer silently coerces JSON objects or arrays to `String`. If your code relies on this behavior, you will see `JsonSyntaxException`.
104
-
-**Built-in ProGuard/R8 rules are included.** Gson 2.11.0 ships its own keep rules, so you may be able to remove custom Gson ProGuard rules from your project.
114
+
-**`TypeToken` with unresolved type variables is rejected at runtime.** Code like
115
+
`object : TypeToken<List<T>>() {}` (where `T` is a generic parameter) will throw
116
+
`IllegalArgumentException`. Use Kotlin `reified` type parameters or pass concrete types instead.
117
+
-**Strict type coercion is enforced.** Gson no longer silently coerces JSON objects or arrays to
118
+
`String`. If your code relies on this behavior, you will see `JsonSyntaxException`.
119
+
-**Built-in ProGuard/R8 rules are included.** Gson 2.11.0 ships its own keep rules, so you may be
120
+
able to remove custom Gson ProGuard rules from your project.
105
121
106
122
If you need to pin Gson to an older version, you can use Gradle's `resolutionStrategy`:
implementation 'com.google.code.gson:gson:2.8.9' // your preferred version
121
137
```
122
138
123
-
> **Note:** Pinning or excluding is not recommended long-term, as the SDK has been tested and validated against Gson 2.11.0.
139
+
> **Note:** Pinning or excluding is not recommended long-term, as the SDK has been tested and
140
+
> validated against Gson 2.11.0.
124
141
125
142
### DefaultClient.Builder
126
143
127
-
v4 introduces a `DefaultClient.Builder` for configuring the HTTP client. This replaces the constructor-based approach with a more flexible builder pattern that supports additional options such as write/call timeouts, custom interceptors, and custom loggers.
144
+
v4 introduces a `DefaultClient.Builder` for configuring the HTTP client. This replaces the
145
+
constructor-based approach with a more flexible builder pattern that supports additional options
146
+
such as write/call timeouts, custom interceptors, and custom loggers.
128
147
129
148
**v3 (constructor-based — deprecated):**
130
149
@@ -149,7 +168,9 @@ val client = DefaultClient.Builder()
149
168
.build()
150
169
```
151
170
152
-
The legacy constructor is deprecated but **not removed** — existing code will continue to compile and run. Your IDE will show a deprecation warning with a suggested `ReplaceWith` quick-fix to migrate to the Builder.
171
+
The legacy constructor is deprecated but **not removed** — existing code will continue to compile
172
+
and run. Your IDE will show a deprecation warning with a suggested `ReplaceWith` quick-fix to
0 commit comments