Skip to content

test(auth): add DPoP RTR pool-server safety-net test (W-23991713) - #4147

Merged
wmathurin merged 4 commits into
forcedotcom:devfrom
wmathurin:dpop-pool-server-test
Aug 26, 2026
Merged

wmathurin merged 4 commits into
forcedotcom:devfrom
wmathurin:dpop-pool-server-test

Conversation

@wmathurin

Copy link
Copy Markdown
Contributor

Summary

  • Adds test_givenDPoPRtr_whenLoginViaPoolServer_thenRefreshTokenSurvivesIdentityFetch to DPoPLoginTests — mirrors the equivalent test on Android (PR Sign In with Apple requirements #3005)
  • Verifies that a pool-server login with DPoP + RTR does not consume the refresh token during the post-login identity fetch
  • Safety net for the RTR-unsafe pattern in SFIdentityCoordinator: if the identity fetch were to trigger a credential refresh (consuming the RTR refresh token), assertRevokeAndRefreshWorks(isRtr: true, ...) would fail because the refresh token would already be spent
  • Test passes today because credentials.identityUrl already holds the raw pool-server URL — SFIdentityCoordinator routes the identity call correctly without needing a credential refresh

Related

  • W-23991713 — iOS story: fix RTR-unsafe credential-refresh in SFIdentityCoordinator + add pool-server DPoP RTR test
  • W-23992239 — Server bug: My Domain /id/ endpoint returns Bad_OAuth_Token for pool-server-issued DPoP tokens instead of 401 use_dpop_nonce
  • Android PR Sign In with Apple requirements #3005 — equivalent fix + test

Test plan

  • test_givenDPoPRtr_whenLoginViaPoolServer_thenRefreshTokenSurvivesIdentityFetch — passes (129 s)
  • test_givenDPoP_whenLoginViaPoolServer_thenTokenTypeIsDPoP — passes, no regression (163 s)

Login via pool server with DPoP + RTR and verify the refresh token
survives the identity fetch. Tests that SFIdentityCoordinator does not
consume the refresh token (via a credential refresh) when resolving the
pool-server-to-My-Domain identity URL routing on login. Mirrors the
equivalent Android test added for the same story.
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
TestsPassed ☑️SkippedFailed ❌️
SalesforceSDKCore iOS ^18 Test Results1009 ran1008 ✅1 ❌
TestResult
SalesforceSDKCore iOS ^18 Test Results
testLogin❌ failure

@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.76%. Comparing base (be15ae7) to head (3d87efe).
⚠️ Report is 7 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #4147      +/-   ##
==========================================
+ Coverage   71.58%   71.76%   +0.18%     
==========================================
  Files         254      254              
  Lines       22837    22827      -10     
==========================================
+ Hits        16347    16382      +35     
+ Misses       6490     6445      -45     
Components Coverage Δ
Analytics 70.78% <ø> (ø)
Common 70.88% <ø> (ø)
Core 67.59% <ø> (+0.29%) ⬆️
SmartStore 73.41% <ø> (-0.05%) ⬇️
MobileSync 88.82% <ø> (-0.02%) ⬇️
see 10 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
TestsPassed ☑️Skipped ⚠️Failed ❌️
AuthFlowTester UI Test Results all111 ran73 ✅4 ⚠️34 ❌
TestResult
AuthFlowTester UI Test Results all
AuthFlowTesterUITests.xctest
ForceAdvancedAuthTests.testForceAdvancedAuth_MyDomainRegularHost_RemainsBrowser()❌ failure
ForceAdvancedAuthTests.testForceAdvancedAuth_Disabled_StandardServer_UsesInAppWebView()❌ failure
MultiUserLoginTests.testLogoutUserWithDynamicConfig_OtherUserUnaffected()❌ failure
MultiUserLoginTests.testFlagDiversity_BeaconNonHybridJwtVsHybridOpaque()❌ failure
MultiUserLoginTests.testBeaconAndNonBeacon_MultiUser()❌ failure
MultiUserLoginTests.testAdvancedAuthUser_HasBWFlag_RegularAuthUser_DoesNot()❌ failure
RefreshTokenMigrationTests.testMigrateBeaconOpaqueToJWTAndBack()❌ failure
RefreshTokenMigrationTests.testMigrateCAToBeaconAndBack()❌ failure
RefreshTokenMigrationTests.testMigrateBeacon_AddMoreScopes()❌ failure
RefreshTokenMigrationTests.testMigrateCAUserAgentToBeaconWebServer()❌ failure
RefreshTokenMigrationTests.testMigrateCAToBeacon()❌ failure
RefreshTokenMigrationTests.testMigrateBeaconToCA()❌ failure
RefreshTokenMigrationTests.testFlagDiversity_MigratedBeaconJwtVsNonHybridOpaque()❌ failure
LoginWithRestartTests.testBeaconOpaque_DefaultScopes_WithRestart()❌ failure
LoginWithRestartTests.testBeaconJwt_SubsetScopes_DynamicConfiguration_WithRestart()❌ failure
LoginWithRestartTests.testBeaconJwt_DefaultScopes_DynamicConfiguration_WithRestart()❌ failure
LoginWithRestartTests.testAdvancedAuth_WithRestart()❌ failure
AdvancedAuthBeaconLoginTests.testBeaconOpaque_SubsetScopes()❌ failure
AdvancedAuthBeaconLoginTests.testBeaconOpaque_AllScopes()❌ failure
AdvancedAuthBeaconLoginTests.testBeaconOpaque_DefaultScopes()❌ failure
AdvancedAuthBeaconLoginTests.testBeaconJwt_AllScopes()❌ failure
AdvancedAuthBeaconLoginTests.testBeaconJwt_DefaultScopes()❌ failure
AdvancedAuthBeaconLoginTests.testBeaconJwt_SubsetScopes()❌ failure
BeaconLoginTests.testBeaconOpaque_SubsetScopes()❌ failure
BeaconLoginTests.testBeaconJwt_SubsetScopes()❌ failure
BeaconLoginTests.testBeaconOpaque_AllScopes()❌ failure
BeaconLoginTests.testBeaconOpaque_DefaultScopes()❌ failure
BeaconLoginTests.testBeaconJwt_DefaultScopes()❌ failure
BeaconLoginTests.testBeaconJwt_AllScopes()❌ failure
RefreshTokenMigrationWithRestartTests.testMigrateCAToBeacon_WithRestart()❌ failure
RefreshTokenMigrationWithRestartTests.testMigrateBeaconScopeAddition_WithRestart()❌ failure
RefreshTokenMigrationWithRestartTests.testMigrateMultipleUsers_WithRestart()❌ failure
WelcomeLoginTests.testWelcomeDiscovery_AdvancedAuthLoginHost_DynamicConfig()❌ failure
WelcomeLoginTests.testWelcomeDiscovery_AdvancedAuthLoginHost()❌ failure

@sfdctaka sfdctaka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@wmathurin
wmathurin merged commit b060821 into forcedotcom:dev Aug 26, 2026
19 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants