Add downgradeFromDPoP for in-place DPoP→Bearer migration - #3004
Merged
Conversation
Add UserAccountManager.downgradeFromDPoP(userAccount, onSuccess, onFailure), the inverse of upgradeToDPoP: it rolls a DPoP-bound session back to unbound Bearer in place using the same connected app, redirect URI, and scopes, independent of the global DPoP setting. It is a no-op (invokes onSuccess with the unchanged account) when the session is already Bearer. AuthFlowTester: add a "Downgrade from DPoP" action (enabled only for a DPoP-bound session), a downgrade UI test, and a downgrade validation helper. Remove an obsolete DPoP test-server entry. Also fix combined-page Custom Tab login in the UI tests: a Salesforce My Domain page renders username and password on one screen, so the previous unconditional "advance" tap submitted an empty password and the position-based field lookup then typed the password into the username field. Now the helper advances only on a genuine two-step page, targets the password field explicitly, and dismisses the soft keyboard before submitting so the Log In button is not covered.
sfdctaka
marked this pull request as ready for review
August 24, 2026 21:48
sfdctaka
requested review from
JohnsonEricAtSalesforce,
brandonpage and
wmathurin
August 24, 2026 21:48
wmathurin
reviewed
Aug 24, 2026
wmathurin
reviewed
Aug 24, 2026
…gger Address review on downgradeFromDPoP: - Remove the dead `wasDPoPBound` flag and its guard. The function returns early when the account is not DPoP-bound, so by the time the success-callback runs the account is always DPoP-bound and the guard was always true. - Drop the bare `SalesforceSDKLogger.w` import and call it class-qualified, matching the `SalesforceSDKLogger.e/.i` style used throughout the file.
wmathurin
approved these changes
Aug 24, 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.
What
Adds
UserAccountManager.downgradeFromDPoP(userAccount, onSuccess, onFailure), the inverse of the existingupgradeToDPoP. It rolls a DPoP-bound session back to unbound Bearer in place — same connected app, redirect URI, and scopes — independent of the globaluseDPoPflag. It is a no-op (invokesonSuccesswith the unchanged account) when the session is already Bearer.Why
Completes the in-place DPoP migration pair so apps can move a user off DPoP without a full logout/login, mirroring
upgradeToDPoP.Changes
UserAccountManagerExtension— newdowngradeFromDPoPextension delegating tomigrateRefreshTokenwithuseDPoP = false; no-op guard when already Bearer. On success it deletes the obsolete DPoP key pair + nonce-cache entries keyed to the pre-downgrade credentials. Also adds a matching no-op guard to the existingupgradeToDPoP(returns the unchanged account when already DPoP-bound).Review notes
strings.xml(sample-app labels for the downgrade button), not the SDK'ssf__strings.xml.