Skip to content

Commit abfae03

Browse files
Copilotswasti29
andcommitted
Cherry-pick PR #1574: Allow cookies in duna resume request
Co-authored-by: swasti29 <12692041+swasti29@users.noreply.github.com>
1 parent f3e27cd commit abfae03

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

IdentityCore/src/MSIDConstants.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ extern NSString * _Nonnull const MSID_FLIGHT_DISABLE_JIT_TROUBLESHOOTING_LEGACY_
217217
extern NSString * _Nonnull const MSID_FLIGHT_CLIENT_SFRT_STATUS;
218218
extern NSString * _Nonnull const MSID_FLIGHT_DISABLE_PREFERRED_IDENTITY_CBA;
219219
extern NSString * _Nonnull const MSID_FLIGHT_SUPPORT_STATE_DUNA_CBA;
220+
extern NSString * _Nonnull const MSID_FLIGHT_IGNORE_COOKIES_IN_DUNA_RESUME;
220221

221222
/**
222223
* Flight to indicate if remove account artifacts should be disabled

IdentityCore/src/MSIDConstants.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
NSString *const MSID_FLIGHT_CLIENT_SFRT_STATUS = @"sfrt_v2";
9090
NSString *const MSID_FLIGHT_DISABLE_PREFERRED_IDENTITY_CBA = @"dis_pre_iden_cba";
9191
NSString *const MSID_FLIGHT_SUPPORT_STATE_DUNA_CBA = @"support_state_duna_cba";
92+
NSString *const MSID_FLIGHT_IGNORE_COOKIES_IN_DUNA_RESUME = @"ignore_cookies_in_duna_resume";
9293

9394
// Making the flight string short to avoid legacy broker url size limit
9495
NSString *const MSID_FLIGHT_DISABLE_REMOVE_ACCOUNT_ARTIFACTS = @"disable_rm_metadata";

IdentityCore/src/webview/operations/ios/MSIDSwitchBrowserResumeOperation.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#import "MSIDInteractiveTokenRequestParameters.h"
3030
#import "MSIDWebResponseOperationFactory.h"
3131
#import "MSIDConstants.h"
32+
#import "MSIDOAuth2Constants.h"
3233
#import "MSIDFlightManager.h"
3334

3435
@interface MSIDSwitchBrowserResumeOperation()
@@ -108,6 +109,15 @@ - (void)invokeWithRequestParameters:(nonnull MSIDInteractiveTokenRequestParamete
108109
webRequestConfiguration.startURL = [[NSURL alloc] initWithString:self.switchBrowserResumeResponse.actionUri];
109110
NSMutableDictionary *customHeaders = [webRequestConfiguration.customHeaders mutableCopy] ?: [NSMutableDictionary new];
110111
customHeaders[@"Authorization"] = [NSString stringWithFormat:@"Bearer %@", self.switchBrowserResumeResponse.switchBrowserSessionToken];
112+
113+
if (![MSIDFlightManager.sharedInstance boolForKey:MSID_FLIGHT_IGNORE_COOKIES_IN_DUNA_RESUME])
114+
{
115+
if (customHeaders[MSID_REFRESH_TOKEN_CREDENTIAL] && [customHeaders[@"Cookie"] isEqualToString:@""])
116+
{
117+
[customHeaders removeObjectForKey:@"Cookie"];
118+
}
119+
}
120+
111121
webRequestConfiguration.customHeaders = customHeaders;
112122

113123
NSObject<MSIDWebviewInteracting> *webView = [oauthFactory.webviewFactory webViewWithConfiguration:webRequestConfiguration

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
TBD:
2+
Allow cookies in duna resume request #1574
3+
14
Version 1.15.0
25
* Query and populate ECC STK in Workplacejoin information for iOS (#1555)
36

0 commit comments

Comments
 (0)