-
Notifications
You must be signed in to change notification settings - Fork 61
feat: Upgrade Auth0.Android to v4.0.0. #918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9bfb220
af: bump Auth0.Android to 4.0.0 and raise Android build floor minSdk β¦
utkrishtsahu e48a9eb
rebuild SecureCredentialsManager against Auth0.Android v4 constructorβ¦
utkrishtsahu 5df1a2e
af: route inline MFA through MfaApiClient for Auth0.Android v4
utkrishtsahu ebd245b
af: move web-auth useDPoP to login builder for Auth0.Android v4
utkrishtsahu 4a863fa
adding Migration guide
utkrishtsahu e8fc37e
af: map SSOCredentials.expiresAt to expiresIn seconds for Auth0.Androβ¦
utkrishtsahu f030738
af: fix unit tests mocking sealed result types for Auth0.Android v4
utkrishtsahu 2eabc76
handled review comments
utkrishtsahu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| # Migration Guide from auth0_flutter v2 to v3 | ||
|
|
||
| `auth0_flutter` v3 upgrades the wrapped native SDKs to their next major versions | ||
| β **Auth0.Android v4** on Android and **Auth0.swift v3** on iOS/macOS. Those | ||
| upgrades raise the minimum platform requirements and change some native | ||
| behavior that surfaces through the Dart API. | ||
|
|
||
| > **Note** | ||
| > This is a living document. It currently covers the **Android** track changes. | ||
| > The remaining cross-platform Dart API renames (for example | ||
| > `expiresIn` β `expiresAt`, `clearSession` β `logout`, `UserInfo` β | ||
| > `UserProfile`) land in later v3 PRs and will be documented here as they merge. | ||
|
|
||
| ## Table of Contents | ||
|
|
||
| - [Requirements Changes](#requirements-changes) | ||
| - [Behavior Changes](#behavior-changes) | ||
| - [`credentialsManager.clearCredentials` now clears all stored data (Android)](#credentialsmanagerclearcredentials-now-clears-all-stored-data-android) | ||
| - [`api.multifactorChallenge` requires `authenticatorId` (Android)](#apimultifactorchallenge-requires-authenticatorid-android) | ||
| - [Getting Help](#getting-help) | ||
|
|
||
| ## Requirements Changes | ||
|
|
||
| Because the underlying native SDKs raised their floors, `auth0_flutter` v3 | ||
| raises the Android minimums: | ||
|
|
||
| | Requirement | v2 | v3 | | ||
| | --- | --- | --- | | ||
| | Android `minSdkVersion` | 21 | **26** (Android 8.0) | | ||
| | Android compile/target SDK | 34 | **36** | | ||
| | JDK (to build the Android module) | 8 | **17** | | ||
| | Kotlin | 1.9.x | **2.0.21** | | ||
| | Android Gradle Plugin | 8.4.x | **8.10.1** | | ||
| | Gradle | 8.7 | **8.11.1** | | ||
|
|
||
| **Migration:** if your app targets an Android `minSdkVersion` below 26, raise it | ||
| to at least 26 in your app's `android/app/build.gradle`. Ensure your build | ||
| environment uses JDK 17 (for example, set it in Android Studio under | ||
| *Settings β Build, Execution, Deployment β Build Tools β Gradle β Gradle JDK*, | ||
| or via `org.gradle.java.home`). | ||
|
|
||
| There are **no source changes required** to your Dart code for these | ||
| requirement bumps. | ||
|
|
||
| ## Behavior Changes | ||
|
|
||
| ### `credentialsManager.clearCredentials` now clears all stored data (Android) | ||
|
|
||
| **Change:** In Auth0.Android v4, `clearCredentials()` performs a full wipe of | ||
| the underlying storage (`Storage.removeAll()`) rather than removing only the | ||
| individual credential entries it wrote. | ||
|
|
||
| **Impact:** If your app stored unrelated values in the same | ||
| `SharedPreferences` instance that the credentials manager uses (for example, by | ||
| supplying a custom `sharedPreferencesName` via | ||
| `CredentialsManagerConfiguration` and reusing it elsewhere), calling | ||
| `clearCredentials` now removes those values too. | ||
|
|
||
| **Migration:** Do not share the credentials manager's storage with other data. | ||
| Keep any app data you need to persist independently of Auth0 credentials in a | ||
| separate store. The Dart API is unchanged: | ||
|
|
||
| ```dart | ||
| // Same call as v2 β behavior on Android is now a full wipe of the store. | ||
| await credentialsManager.clearCredentials(); | ||
| ``` | ||
|
|
||
| This affects Android only. iOS/macOS behavior is unchanged. | ||
|
|
||
| ### `api.multifactorChallenge` requires `authenticatorId` (Android) | ||
|
|
||
| **Change:** Auth0.Android v4 removed the inline MFA methods from the | ||
| authentication client and routes MFA through a dedicated MFA client whose | ||
| `challenge` operation accepts only an `authenticatorId` β there is no | ||
| challenge-type filtering. | ||
|
|
||
| **Impact:** On Android, a `multifactorChallenge` call must now include | ||
| `authenticatorId`. A call that supplies only `types` and omits | ||
| `authenticatorId` β which was accepted in v2 β now fails on Android. Any `types` | ||
| value passed is ignored on Android. | ||
|
|
||
| > **Note** | ||
| > The Dart signature of `multifactorChallenge` is unchanged in this release | ||
| > (`types` and `authenticatorId` remain optional parameters), so this is a | ||
| > runtime behavior change on Android rather than a compile-time break. iOS | ||
| > already requires `authenticatorId`. A later v3 PR realigns the shared Dart | ||
| > API to make `authenticatorId` required and remove `types` across platforms. | ||
|
|
||
| **Migration:** Always pass `authenticatorId` when calling | ||
| `multifactorChallenge`, and stop relying on `types`: | ||
|
|
||
| ```dart | ||
| // β v2 β worked on Android, relied on challenge-type filtering | ||
| final challenge = await auth0.api.multifactorChallenge( | ||
| mfaToken: mfaToken, | ||
| types: [ChallengeType.otp, ChallengeType.oob], | ||
| ); | ||
|
|
||
| // β v3 β pass the authenticator to challenge | ||
| final challenge = await auth0.api.multifactorChallenge( | ||
| mfaToken: mfaToken, | ||
| authenticatorId: authenticatorId, | ||
| ); | ||
| ``` | ||
|
|
||
| If you support one-time passwords and don't need to select a specific factor, | ||
| you can skip the challenge request and call `api.loginWithOtp` directly. | ||
|
|
||
| ## Getting Help | ||
|
|
||
| If you encounter issues migrating, please open an issue on the | ||
| [auth0-flutter repository](https://github.com/auth0/auth0-flutter/issues) with | ||
| details of the API you're migrating and the platform affected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.