Add Login for Admin feature#2870
Merged
brandonpage merged 2 commits intoforcedotcom:devfrom Apr 23, 2026
Merged
Conversation
…and custom tabs routing.
Generated by 🚫 Danger |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #2870 +/- ##
============================================
- Coverage 64.90% 64.89% -0.02%
- Complexity 2974 2979 +5
============================================
Files 222 222
Lines 17449 17489 +40
Branches 2489 2496 +7
============================================
+ Hits 11325 11349 +24
- Misses 4920 4926 +6
- Partials 1204 1214 +10
🚀 New features to boost your workflow:
|
brandonpage
added a commit
that referenced
this pull request
Apr 25, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The Android implementation of this feature is quite a bit more involved and far reaching than its iOS counterpart. I choose to do a mini re-write of how the
LoginViewModelhandles generating urls because:loginUrl,browserCustomTabUrl, the authorization url used for token migration and the authorization url used for front door bridge were all created from a single function that retuned a single url. With the Web Server flow, running that function a second time generates a new code verifier and will break login using any previously generated url. I foresee future scenarios where this becomes very problematic if we are starting and cancelling/switching different auth flows.BrowserCustomTabUrlSourceit was possible to generate an authorization url forsingleServerCustomTabActivitythat did not use the Web Server Flow, which should never be allowed.if (!sdkManager.isBrowserLoginEnabled && !singleServerCustomTabActivity && !viewModel.isUsingFrontDoorBridge ....To address the above issues, this PR:
getAuthorizationUrltogenerateAuthorizationUrl(maybe it should be plural?), which sets bothloginUrlandbrowserCustomTabUrland returns nothing.generateMigrationAuthorizationPathfunction to handle Token Migration Authorization Url generation separately.frontDoorBridgeUrlvariable sologinUrlnever needs to be re-generated to avoid using Web Server.onBrowserCustomTabReadylaunching mechanism.Demo of cancelling 'Login for Admin' vs org triggered Advanced Auth:
login_for_admin_cancel.mp4