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
+78-4Lines changed: 78 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,30 @@
1
1
# Migration Guide from SDK v3 to v4
2
2
3
-
## Overview
3
+
> **Note:** This guide is actively maintained during the v4 development phase. As new changes are merged, this document will be updated to reflect the latest breaking changes and migration steps.
4
4
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.
5
+
v4 of the Auth0 Android SDK includes significant build toolchain updates, updated default values for better out-of-the-box behavior, and behavior changes to simplify credential management. This guide documents the changes required when migrating from v3 to v4.
**Reason:** A `minTtl` of `0` meant credentials were not renewed until expired, which could result in delivering access tokens that expire immediately after retrieval, causing subsequent API requests to fail. Setting a default value of `60` seconds ensures the access token remains valid for a reasonable period.
159
+
160
+
## Behavior Changes
161
+
162
+
### `clearCredentials()` Now Clears All Storage
163
+
164
+
**Change:**`clearCredentials()` now calls `Storage.removeAll()` instead of removing individual credential keys.
165
+
166
+
In v3, `clearCredentials()` removed only specific credential keys (access token, refresh token, ID token, etc.) from the underlying `Storage`.
167
+
168
+
In v4, `clearCredentials()` calls `Storage.removeAll()`, which clears **all** values in the storage — including any API credentials stored for specific audiences.
169
+
170
+
**Impact:** If you need to remove only the primary credentials while preserving other stored data, consider using a separate `Storage` instance for API credentials.
171
+
172
+
**Reason:** This simplifies credential cleanup and ensures no stale data remains in storage after logout. It aligns the behavior with the Swift SDK's `clear()` method, which also clears all stored values.
173
+
174
+
### `Storage` Interface: New `removeAll()` Method
175
+
176
+
**Change:** The `Storage` interface now includes a `removeAll()` method with a default empty implementation.
177
+
178
+
**Impact:** Existing custom `Storage` implementations will continue to compile and work without changes. Override `removeAll()` to provide the actual clearing behavior if your custom storage is used with `clearCredentials()`.
0 commit comments