-
Notifications
You must be signed in to change notification settings - Fork 36
Add new option into MSIDRequestParameters to skip cache on broker response #1661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
| #pragma mark - Xpc Mode | ||
| @property (nonatomic) MSIDXpcMode xpcMode; | ||
|
|
||
| #pragma mark - monitor gcd thread starvation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request does not update changelog.txt.
Please consider if this change would be noticeable to a partner or user and either update changelog.txt or resolve this conversation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new option skipTokenCacheFromBrokerResponse to MSIDRequestParameters that allows skipping the cache when processing broker responses. This enables callers to receive tokens from the broker without automatically caching them in the token cache.
Changes:
- Added
skipTokenCacheFromBrokerResponseboolean property toMSIDRequestParameters - Modified token validation flow to conditionally skip caching based on this flag
- Updated broker request/response handlers to pass the flag through the validation pipeline
- Updated all affected test cases to assert the new parameter in request dictionaries
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| MSIDRequestParameters.h | Added new property declaration for skipTokenCacheFromBrokerResponse |
| MSIDBrokerTokenRequest.m | Serializes the new property to the broker resume dictionary |
| MSIDBrokerResponseHandler.m | Reads skipCacheBrokerResponse from resume state and passes to validator |
| MSIDTokenResponseValidator.h/.m | Added skipCacheBrokerResponse parameter to validation methods and conditional cache logic |
| MSIDDefaultBrokerResponseHandler.m | Passes NO for skipCacheBrokerResponse when handling additional tokens |
| MSIDLegacyBrokerResponseHandler.m | Passes NO for skipCacheBrokerResponse for Intune MAM tokens |
| MSIDSSOTokenResponseHandler.m | Resets skipTokenCacheFromBrokerResponse to NO for additional token responses |
| MSIDLegacyBrokerRequestTests.m | Updated test assertions to include the new parameter with value YES |
| MSIDDefaultBrokerRequestTests.m | Updated test assertions to include the new parameter with value NO |
| MSIDBrokerTokenRequestTests.m | Updated test setup and assertions to include the new parameter with value YES |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
IdentityCore/tests/integration/ios/MSIDLegacyBrokerRequestTests.m
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Proposed changes
This pull request introduces a new property to control whether token responses from SSO Extension should be skipped when saving to the cache, and updates the relevant logic to respect this setting. The changes are focused on providing more granular control over token caching behavior, particularly for SSO Extension responses.
Token caching control improvements:
skipTokenCacheFromSsoExtensionResponsetoMSIDRequestParametersto allow skipping cache of SSO Extension token responses.MSIDTokenResponseValidatorto check the newskipTokenCacheFromSsoExtensionResponseproperty before saving token responses to cache.MSIDSSOTokenResponseHandlerto resetskipTokenCacheFromSsoExtensionResponsetoNOwhen handling additional token responses, ensuring they are still cached as required.The feature is expected to be controlled by ECS flight when integrating into OA
Type of change
Risk
Additional information
AB#3403754