Skip to content

[iOS] Capture ui_sid from DPoP token response and use it in mainSid - #4154

Merged
wmathurin merged 1 commit into
forcedotcom:devfrom
wmathurin:ui-sid
Aug 28, 2026
Merged

[iOS] Capture ui_sid from DPoP token response and use it in mainSid#4154
wmathurin merged 1 commit into
forcedotcom:devfrom
wmathurin:ui-sid

Conversation

@wmathurin

@wmathurin wmathurin commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds uiSid property to SFOAuthCredentials (public readonly in .h, readwrite in +Internal.h)
  • Persists uiSid to the keychain in SFOAuthKeychainCredentials under com.salesforce.mobilesdk.oauth.uiSid
  • In updateCredentials:, reads ui_sid from the token endpoint response, guarded on tokenType == "dpop"
  • Updates mainSid getter: returns uiSid if present, otherwise falls back to existing logic (parentSid for jwt, accessToken otherwise)
  • Adds 4 unit tests in SFOAuthCredentialsTests.m

Dependencies

This PR depends on (already merged):

Related PRs (same feature):

Tracking

  • W-24024985 — [iOS] Capture ui_sid from token endpoint and use it in mainSid
  • Fixes W-23984602

…inSid

Adds uiSid to SFOAuthCredentials: captured when tokenType is "dpop",
stored encrypted in keychain under a new service key. Updates mainSid
to return uiSid first, falling back to the existing jwt/access-token logic.
@github-actions

Copy link
Copy Markdown
1 Warning
⚠️ Static Analysis found an issue with one or more files you modified. Please fix the issue(s).

Clang Static Analysis Issues

File Type Category Description Line Col
SFOAuthCredentials Dereference of null pointer Logic error Access to instance variable '_credentialsChangeSet' results in a dereference of a null pointer (loaded from variable 'self') 200 27
SFOAuthCredentials Nullability Memory error nil passed to a callee that requires a non-null 1st parameter 306 20
SFOAuthKeychainCredentials Dead initialization Unused code Value stored to 'result' during its initialization is never read 182 26

Generated by 🚫 Danger

@github-actions

Copy link
Copy Markdown
TestsPassedSkippedFailed ❌️
AuthFlowTester UI Test Results all1 ran1 ❌
TestResult
AuthFlowTester UI Test Results all
AuthFlowTesterUITests.xctest
LegacyLoginTests.testCAOpaque_DefaultScopes_WebServerFlow()❌ failure

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.44%. Comparing base (33d3b55) to head (c69e084).
⚠️ Report is 5 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #4154      +/-   ##
==========================================
- Coverage   67.46%   67.44%   -0.02%     
==========================================
  Files         254      254              
  Lines       22859    22868       +9     
==========================================
+ Hits        15422    15424       +2     
- Misses       7437     7444       +7     
Components Coverage Δ
Analytics 70.78% <ø> (ø)
Common 70.88% <ø> (ø)
Core 61.10% <100.00%> (-0.03%) ⬇️
SmartStore 73.45% <ø> (ø)
MobileSync 88.84% <ø> (ø)
Files with missing lines Coverage Δ
...lesforceSDKCore/Classes/OAuth/SFOAuthCredentials.m 92.13% <100.00%> (+0.13%) ⬆️
...SDKCore/Classes/OAuth/SFOAuthKeychainCredentials.m 93.02% <100.00%> (+0.34%) ⬆️

... and 1 file 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

Copy link
Copy Markdown
TestsPassed ✅SkippedFailed
SalesforceSDKCore iOS ^18 Test Results1015 ran1015 ✅
TestResult
No test annotations available

@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!

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