[iOS] AuthFlowTester: display mainSid/uiSid and assert them in tests - #4157
Merged
Conversation
- UserCredentialsView: add mainSid and uiSid rows in Domains and SIDs section - AuthFlowTesterMainPageObject: add mainSid/uiSid to UserCredentialsData struct and JSON parsing - BaseAuthFlowTester.assertSIDs: add isDPoP param; assert mainSid always non-empty, uiSid non-empty on DPoP, and mainSid == uiSid (DPoP) / parentSid (JWT hybrid) / accessToken (opaque) as appropriate
3 tasks
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #4157 +/- ##
==========================================
+ Coverage 67.44% 71.21% +3.76%
==========================================
Files 254 254
Lines 22868 22868
==========================================
+ Hits 15424 16286 +862
+ Misses 7444 6582 -862
🚀 New features to boost your workflow:
|
…e case The token type comparison in updateCredentials: used @"dpop" (lowercase) but the server returns @"DPoP" (mixed case), so uiSid was never captured after login even when the server provided it. Fix: add kSFOAuthDPoPTokenType = @"DPoP" to SFSDKOAuthConstants.h and use it in SFOAuthCredentials.m and SalesforceSDKManager.m. Update SFOAuthCredentialsTests.m to pass the correct mixed-case token type that the server actually sends. Note: DPoPRequestDecorator.isDPoPTokenType(_:) already performs a case-insensitive comparison (RFC-compliant), which is why the test at line 292 of SFSDKDPoPTests that passes "dpop" is intentional and stays.
Clang Static Analysis Issues
Generated by 🚫 Danger |
|
||||||||||||||||
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
Bug fix: uiSid was never captured in DPoP sessions
`SFOAuthCredentials.updateCredentials:` compared the server-returned token type against the lowercase literal `@"dpop"`, but the server returns `@"DPoP"` (mixed case). The case-sensitive `isEqualToString:` comparison always failed, so `uiSid` was set to `nil` on every DPoP login.
Fix: added `kSFOAuthDPoPTokenType = @"DPoP"` to `SFSDKOAuthConstants.h` and replaced all bare string literals in production code with this constant. Updated `SFOAuthCredentialsTests.m` to pass the correct mixed-case token type the server actually sends.
Note: `DPoPRequestDecorator.isDPoPTokenType(_:)` already performs a case-insensitive comparison (RFC-compliant); the existing test that passes `"dpop"` to that method is intentional and unchanged.
Dependencies
Builds on top of merged PRs:
Related Android PR: forcedotcom/SalesforceMobileSDK-Android#3020
Test plan