|
28 | 28 | #import "MSIDWebviewFactory.h" |
29 | 29 | #import "MSIDInteractiveTokenRequestParameters.h" |
30 | 30 | #import "MSIDWebResponseOperationFactory.h" |
| 31 | +#import "MSIDConstants.h" |
| 32 | +#import "MSIDFlightManager.h" |
31 | 33 |
|
32 | 34 | @interface MSIDSwitchBrowserResumeOperation() |
33 | 35 |
|
@@ -87,17 +89,20 @@ - (void)invokeWithRequestParameters:(nonnull MSIDInteractiveTokenRequestParamete |
87 | 89 | webviewResponseCompletionBlock:(nonnull MSIDWebviewAuthCompletionHandler)webviewResponseCompletionBlock |
88 | 90 | authorizationCodeCompletionBlock:(nonnull MSIDInteractiveAuthorizationCodeCompletionBlock)authorizationCodeCompletionBlock |
89 | 91 | { |
90 | | - MSIDSwitchBrowserResponse *parentResponse = (MSIDSwitchBrowserResponse *)self.switchBrowserResumeResponse.parentResponse; |
91 | | - NSError *stateValidationError = nil; |
92 | | - |
93 | | - BOOL stateValidated = [MSIDSwitchBrowserResponse validateStateParameter:self.switchBrowserResumeResponse.state |
94 | | - expectedState:parentResponse.state |
95 | | - error:&stateValidationError]; |
96 | | - if (!stateValidated) |
| 92 | + if ([MSIDFlightManager.sharedInstance boolForKey:MSID_FLIGHT_SUPPORT_STATE_VALIDATION_DUNA_CBA]) |
97 | 93 | { |
98 | | - MSID_LOG_WITH_CTX(MSIDLogLevelError, requestParameters, @"Resume operation rejected due to state validation failure"); |
99 | | - if (webviewResponseCompletionBlock) webviewResponseCompletionBlock(nil, stateValidationError); |
100 | | - return; |
| 94 | + MSIDSwitchBrowserResponse *parentResponse = (MSIDSwitchBrowserResponse *)self.switchBrowserResumeResponse.parentResponse; |
| 95 | + NSError *stateValidationError = nil; |
| 96 | + |
| 97 | + BOOL stateValidated = [MSIDSwitchBrowserResponse validateStateParameter:self.switchBrowserResumeResponse.state |
| 98 | + expectedState:parentResponse.state |
| 99 | + error:&stateValidationError]; |
| 100 | + if (!stateValidated) |
| 101 | + { |
| 102 | + MSID_LOG_WITH_CTX(MSIDLogLevelError, requestParameters, @"Resume operation rejected due to state validation failure"); |
| 103 | + if (webviewResponseCompletionBlock) webviewResponseCompletionBlock(nil, stateValidationError); |
| 104 | + return; |
| 105 | + } |
101 | 106 | } |
102 | 107 |
|
103 | 108 | webRequestConfiguration.startURL = [[NSURL alloc] initWithString:self.switchBrowserResumeResponse.actionUri]; |
|
0 commit comments