Fix MSIDRequestParameters copyWithZone method missing critical properties causing automation test failures #2692
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.
The automation test failures after PR #2685 were caused by an incomplete
copyWithZone
method inMSIDRequestParameters
that was missing several critical properties, including the newly introducedbypassRedirectURIValidation
property.Problem
When MSAL created request parameters and they were copied during request processing, properties were being lost because the
copyWithZone
method was not copying all declared properties. This caused thebypassRedirectURIValidation
feature to malfunction, as the property would revert to its default value (NO
) instead of preserving the configured value.Root Cause
The
copyWithZone
method inMSIDRequestParameters.m
was missing assignments for 10 properties:bypassRedirectURIValidation
- Critical for the new bypass redirect validation featureignoreScopeValidation
- Could cause unexpected scope validation failuresforceRefresh
- Could prevent forced token refresh behaviorallowAnyExtraURLQueryParameters
- Could block required query parametersallowUsingLocalCachedRtWhenSsoExtFailed
- Could affect SSO fallback behaviorclientBrokerKeyCapabilityNotSupported
- Could affect broker key capabilitieswebPageUri
- Could lose web page URI informationnonce
- Could lose security nonceauthScheme
- Could lose authentication scheme informationssoContext
- Could lose SSO context informationSolution
Updated the
copyWithZone
method inMSAL/IdentityCore/IdentityCore/src/parameters/MSIDRequestParameters.m
to include all missing property assignments, ensuring complete object copying.Added comprehensive unit test
testCopyWithZone_shouldCopyAllProperties_includingBypassRedirectURIValidation
to verify that all critical properties are properly preserved during copy operations and prevent regression.Impact
This fix ensures that when request parameters are copied during authentication flows, all properties are properly preserved, resolving the automation test failures and ensuring the
bypassRedirectURIValidation
feature works as intended.Fixes #2690.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.