Conversation
Servers return lowercase "dpop" in token refresh responses per RFC 6749 §5.1. Case-sensitive comparisons caused addAuthorizationHeader to use Bearer and shouldAttachDPoP to return false, producing INVALID_AUTH_HEADER 401s on every post-refresh request. Changes: - DPoPKeyManager: add isDPoPTokenType() helper (equalsIgnoreCase); use in shouldAttachDPoP - OAuth2.java: switch addAuthorizationHeader and uiSid assignments to isDPoPTokenType() - UserAccountManagerExtension: fix upgradeToDPoP / downgradeFromDPoP early-exit checks - AuthenticationUtilities: fix FEATURE_DPOP telemetry registration - DevSupportInfo: fix DPoP nonce display in dev support overlay - Tests: add isDPoPTokenType case-insensitivity tests, shouldAttachDPoP lowercase regression, and applyAuthHeaders_lowercaseDPoPTokenType_stampsDPoPSchemeNotBearer regression test
Generated by 🚫 Danger |
3 tasks
brandonpage
approved these changes
Sep 1, 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.
Summary
==in Kotlin,.equals()in Java) against the literal"DPoP". RFC 6749 §5.1 definestoken_typeas case-insensitive; servers are permitted to return any casing. The fix adds anisDPoPTokenType()helper (usingequalsIgnoreCase) toDPoPKeyManagerand applies it to all five call sites."DPoP"in refresh responses. The fix eliminates a latent failure mode for orgs/server versions that may return lowercase."DPoP".Files changed
DPoPKeyManager.ktisDPoPTokenType()helper; use inshouldAttachDPoPOAuth2.javaaddAuthorizationHeaderscheme + bothuiSidassignmentsUserAccountManagerExtension.ktupgradeToDPoP/downgradeFromDPoPearly-exitsAuthenticationUtilities.ktFEATURE_DPOPtelemetry registrationDevSupportInfo.ktTest plan
test_isDPoPTokenType_matchesCaseInsensitivelyAndRejectsNilEmptypassestest_shouldAttachDPoP_lowercaseDPoPTokenType_returnsTruepassesapplyAuthHeaders_lowercaseDPoPTokenType_stampsDPoPSchemeNotBearerpassesSalesforceSDKconnected suite: 423/423 pass on emulatorRelated
GUS: W-24027018
iOS counterpart: forcedotcom/SalesforceMobileSDK-iOS#4159