Skip to content

Commit b4fd324

Browse files
authored
Merge pull request #1432 from AzureAD/release/1.7.42
Release/1.7.42
2 parents cc1ba8e + ba3ae80 commit b4fd324

File tree

43 files changed

+1139
-782
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1139
-782
lines changed

IdentityCore/IdentityCore.xcodeproj/project.pbxproj

+16
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,7 @@
621621
6078EB51226DA97200235498 /* MSIDTestCacheUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 6078EB4D226DA73600235498 /* MSIDTestCacheUtil.m */; };
622622
607A788D23294D6F00A1F74D /* MSIDAccountMetadataCacheAccessorMock.m in Sources */ = {isa = PBXBuildFile; fileRef = 607A788C23294D6F00A1F74D /* MSIDAccountMetadataCacheAccessorMock.m */; };
623623
607A788E23294D6F00A1F74D /* MSIDAccountMetadataCacheAccessorMock.m in Sources */ = {isa = PBXBuildFile; fileRef = 607A788C23294D6F00A1F74D /* MSIDAccountMetadataCacheAccessorMock.m */; };
624+
607E6A8C2CAF04D700948365 /* MSIDCustomHeaderProviding.h in Headers */ = {isa = PBXBuildFile; fileRef = 607E6A8B2CAF04D700948365 /* MSIDCustomHeaderProviding.h */; };
624625
6080B97A2384BD17009B1322 /* MSIDAccountMetadataCacheItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 6080B9792384BD17009B1322 /* MSIDAccountMetadataCacheItem.m */; };
625626
6080B97B2384BD17009B1322 /* MSIDAccountMetadataCacheItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 6080B9792384BD17009B1322 /* MSIDAccountMetadataCacheItem.m */; };
626627
6080B9A523886DD9009B1322 /* MSIDBrokerOperationGetDeviceInfoRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6080B9A423886DD9009B1322 /* MSIDBrokerOperationGetDeviceInfoRequestTests.m */; };
@@ -2455,6 +2456,7 @@
24552456
6078EB4D226DA73600235498 /* MSIDTestCacheUtil.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDTestCacheUtil.m; sourceTree = "<group>"; };
24562457
607A788B23294D2400A1F74D /* MSIDAccountMetadataCacheAccessorMock.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDAccountMetadataCacheAccessorMock.h; sourceTree = "<group>"; };
24572458
607A788C23294D6F00A1F74D /* MSIDAccountMetadataCacheAccessorMock.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDAccountMetadataCacheAccessorMock.m; sourceTree = "<group>"; };
2459+
607E6A8B2CAF04D700948365 /* MSIDCustomHeaderProviding.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDCustomHeaderProviding.h; sourceTree = "<group>"; };
24582460
6080B9782384BD01009B1322 /* MSIDAccountMetadataCacheItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDAccountMetadataCacheItem.h; sourceTree = "<group>"; };
24592461
6080B9792384BD17009B1322 /* MSIDAccountMetadataCacheItem.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDAccountMetadataCacheItem.m; sourceTree = "<group>"; };
24602462
6080B9A423886DD9009B1322 /* MSIDBrokerOperationGetDeviceInfoRequestTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDBrokerOperationGetDeviceInfoRequestTests.m; sourceTree = "<group>"; };
@@ -4088,6 +4090,14 @@
40884090
path = account_request;
40894091
sourceTree = "<group>";
40904092
};
4093+
607E6A872CAF03C400948365 /* customHeaderProviding */ = {
4094+
isa = PBXGroup;
4095+
children = (
4096+
607E6A8B2CAF04D700948365 /* MSIDCustomHeaderProviding.h */,
4097+
);
4098+
path = customHeaderProviding;
4099+
sourceTree = "<group>";
4100+
};
40914101
609E74BA228CA3C2005E3FED /* metadata */ = {
40924102
isa = PBXGroup;
40934103
children = (
@@ -4323,6 +4333,7 @@
43234333
6057EE8F20B5FDF8007976EB /* MSIDAADOAuthEmbeddedWebviewController.m */,
43244334
60B3856D20AB3CDC00D546D0 /* ui */,
43254335
96235FA0207D786A007EAB36 /* challangeHandlers */,
4336+
607E6A872CAF03C400948365 /* customHeaderProviding */,
43264337
);
43274338
path = embeddedWebview;
43284339
sourceTree = "<group>";
@@ -6076,6 +6087,7 @@
60766087
B26A0B8C2071B763006BD95A /* MSIDAADV1Oauth2Factory.h in Headers */,
60776088
B2C708B4219A620E00D917B8 /* MSIDBrokerCryptoProvider.h in Headers */,
60786089
B2CDB5791FE33A46003A4B5C /* MSIDAccount.h in Headers */,
6090+
607E6A8C2CAF04D700948365 /* MSIDCustomHeaderProviding.h in Headers */,
60796091
B2AF1D40218BD10A0080C1A0 /* MSIDRequestParameters.h in Headers */,
60806092
B2C7089721991D0000D917B8 /* MSIDAADV2BrokerResponse.h in Headers */,
60816093
E733EDEF25C0A49500ACB79A /* MSIDThumbprintCalculator.h in Headers */,
@@ -8108,6 +8120,7 @@
81088120
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
81098121
SWIFT_VERSION = 5.0;
81108122
TARGETED_DEVICE_FAMILY = "1,2,7";
8123+
XROS_DEPLOYMENT_TARGET = 1.2;
81118124
};
81128125
name = Debug;
81138126
};
@@ -8169,6 +8182,7 @@
81698182
SWIFT_VERSION = 5.0;
81708183
TARGETED_DEVICE_FAMILY = "1,2,7";
81718184
VALIDATE_PRODUCT = YES;
8185+
XROS_DEPLOYMENT_TARGET = 1.2;
81728186
};
81738187
name = Release;
81748188
};
@@ -8227,6 +8241,7 @@
82278241
SDKROOT = iphoneos;
82288242
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
82298243
TARGETED_DEVICE_FAMILY = "1,2,7";
8244+
XROS_DEPLOYMENT_TARGET = 1.2;
82308245
};
82318246
name = Debug;
82328247
};
@@ -8279,6 +8294,7 @@
82798294
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
82808295
TARGETED_DEVICE_FAMILY = "1,2,7";
82818296
VALIDATE_PRODUCT = YES;
8297+
XROS_DEPLOYMENT_TARGET = 1.2;
82828298
};
82838299
name = Release;
82848300
};

IdentityCore/src/broker_operation/request/browser_native_message_request/MSIDBrokerOperationBrowserNativeMessageRequest.h

+9
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ NS_ASSUME_NONNULL_BEGIN
3030
@interface MSIDBrokerOperationBrowserNativeMessageRequest : MSIDBrokerOperationRequest
3131

3232
@property (nonatomic) NSDictionary *payloadJson;
33+
@property (nonatomic) NSString *parentProcessBundleIdentifier;
34+
@property (nonatomic) NSString *parentProcessTeamId;
35+
@property (nonatomic) NSString *parentProcessLocalizedName;
36+
37+
@property (nonatomic, readonly) NSString *callerBundleIdentifier;
38+
@property (nonatomic, readonly) NSString *callerTeamIdentifier API_AVAILABLE(ios(14.0), macos(11.0)) API_UNAVAILABLE(watchos, tvos);
39+
@property (nonatomic, readonly) NSString *localizedCallerDisplayName API_AVAILABLE(ios(14.0), macos(11.0)) API_UNAVAILABLE(watchos, tvos);
40+
@property (nonatomic, readonly) NSString *localizedApplicationInfo API_AVAILABLE(ios(14.0), macos(11.0)) API_UNAVAILABLE(watchos, tvos);
41+
3342
@property (nonatomic, readonly) NSString *method;
3443

3544
@end

IdentityCore/src/broker_operation/request/browser_native_message_request/MSIDBrokerOperationBrowserNativeMessageRequest.m

+43
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@
2727
#import "MSIDJsonSerializableTypes.h"
2828
#import "MSIDJsonSerializableFactory.h"
2929
#import "NSDictionary+MSIDExtensions.h"
30+
#import "MSIDBrowserNativeMessageRequest.h"
3031

3132
NSString *const MSID_BROWSER_NATIVE_MESSAGE_REQUEST_PAYLOAD_KEY = @"payload";
3233
NSString *const MSID_BROWSER_NATIVE_MESSAGE_REQUEST_METHOD_KEY = @"method";
34+
NSString *const MSID_BROWSER_NATIVE_MESSAGE_REQUEST_PPTID_KEY = @"parent_process_teamId";
35+
NSString *const MSID_BROWSER_NATIVE_MESSAGE_REQUEST_PPBI_KEY = @"parent_process_bundle_identifier";
36+
NSString *const MSID_BROWSER_NATIVE_MESSAGE_REQUEST_PPLN_KEY = @"parent_process_localized_name";
3337

3438
@implementation MSIDBrokerOperationBrowserNativeMessageRequest
3539

@@ -50,6 +54,37 @@ + (NSString *)operation
5054
return MSID_JSON_TYPE_OPERATION_REQUEST_BROWSER_NATIVE_MESSAGE;
5155
}
5256

57+
- (NSString *)callerBundleIdentifier
58+
{
59+
return self.parentProcessBundleIdentifier ?: NSLocalizedString(@"N/A", nil);
60+
}
61+
62+
- (NSString *)callerTeamIdentifier
63+
{
64+
return self.parentProcessTeamId ?: NSLocalizedString(@"N/A", nil);
65+
}
66+
67+
- (NSString *)localizedCallerDisplayName
68+
{
69+
return self.parentProcessLocalizedName ?: NSLocalizedString(@"N/A", nil);
70+
}
71+
72+
- (NSString *)localizedApplicationInfo
73+
{
74+
NSString *method = self.payloadJson[MSID_BROWSER_NATIVE_MESSAGE_REQUEST_METHOD_KEY];
75+
MSIDBrowserNativeMessageRequest *brokerOperationRequest = [MSIDJsonSerializableFactory createFromJSONDictionary:self.payloadJson
76+
classType:method
77+
assertKindOfClass:MSIDBrowserNativeMessageRequest.class
78+
error:nil];
79+
80+
if (![NSString msidIsStringNilOrBlank:brokerOperationRequest.localizedApplicationInfo])
81+
{
82+
return brokerOperationRequest.localizedApplicationInfo;
83+
}
84+
85+
return NSLocalizedString(@"N/A", nil);
86+
}
87+
5388
#pragma mark - MSIDJsonSerializable
5489

5590
- (instancetype)initWithJSONDictionary:(NSDictionary *)json error:(NSError *__autoreleasing*)error
@@ -81,6 +116,10 @@ - (instancetype)initWithJSONDictionary:(NSDictionary *)json error:(NSError *__au
81116

82117
return nil;
83118
}
119+
120+
_parentProcessTeamId = [json msidStringObjectForKey:MSID_BROWSER_NATIVE_MESSAGE_REQUEST_PPTID_KEY];
121+
_parentProcessBundleIdentifier = [json msidStringObjectForKey:MSID_BROWSER_NATIVE_MESSAGE_REQUEST_PPBI_KEY];
122+
_parentProcessLocalizedName = [json msidStringObjectForKey:MSID_BROWSER_NATIVE_MESSAGE_REQUEST_PPLN_KEY];
84123
}
85124

86125
return self;
@@ -94,6 +133,10 @@ - (NSDictionary *)jsonDictionary
94133

95134
json[MSID_BROWSER_NATIVE_MESSAGE_REQUEST_PAYLOAD_KEY] = [self.payloadJson msidJSONSerializeWithContext:nil];
96135

136+
json[MSID_BROWSER_NATIVE_MESSAGE_REQUEST_PPTID_KEY] = self.parentProcessTeamId;
137+
json[MSID_BROWSER_NATIVE_MESSAGE_REQUEST_PPBI_KEY] = self.parentProcessBundleIdentifier;
138+
json[MSID_BROWSER_NATIVE_MESSAGE_REQUEST_PPLN_KEY] = self.parentProcessLocalizedName;
139+
97140
return json;
98141
}
99142

IdentityCore/src/broker_operation/request/browser_native_message_request/MSIDBrowserNativeMessageGetTokenRequest.m

+16
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,22 @@ + (NSString *)operation
5858
return @"GetToken";
5959
}
6060

61+
#pragma mark - MSIDBrokerOperationRequest
62+
63+
- (NSString *)localizedApplicationInfo
64+
{
65+
// clientId && redirectUri are requered params and should be validated during init.
66+
NSParameterAssert(self.clientId);
67+
NSParameterAssert(self.redirectUri);
68+
__auto_type clientId = self.clientId ?: @"";
69+
__auto_type redirectUri = self.redirectUri ?: @"";
70+
71+
NSString *clientIdKey = NSLocalizedString(@"Client ID", nil);
72+
NSString *redirectUriKey = NSLocalizedString(@"Redirect URI", nil);
73+
74+
return [NSString stringWithFormat:@"%@: %@ %@: %@", clientIdKey, clientId, redirectUriKey, redirectUri];
75+
}
76+
6177
#pragma mark - MSIDJsonSerializable
6278

6379
- (instancetype)initWithJSONDictionary:(NSDictionary *)json error:(NSError *__autoreleasing*)error

IdentityCore/src/broker_operation/request/browser_native_message_request/MSIDBrowserNativeMessageRequest.h

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ NS_ASSUME_NONNULL_BEGIN
3333
/// Url of the request sender.
3434
@property (nonatomic) NSURL *sender;
3535

36+
@property (nonatomic, readonly) NSString *localizedApplicationInfo;
37+
3638
@end
3739

3840
NS_ASSUME_NONNULL_END

IdentityCore/src/cache/accessor/MSIDDefaultTokenCacheAccessor.h

+5
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,9 @@
111111
context:(id<MSIDRequestContext>)context
112112
error:(NSError *__autoreleasing*)error;
113113

114+
- (NSArray<MSIDPrimaryRefreshToken *> *)getPrimaryRefreshTokensForConfiguration:(MSIDConfiguration *)configuration
115+
account:(MSIDAccountIdentifier *)accountIdentifier
116+
context:(id<MSIDRequestContext>)context
117+
error:(NSError *__autoreleasing*)error;
118+
114119
@end

IdentityCore/src/cache/accessor/MSIDDefaultTokenCacheAccessor.m

+9
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,19 @@ - (MSIDPrimaryRefreshToken *)getPrimaryRefreshTokenWithAccount:(MSIDAccountIdent
193193
- (NSArray<MSIDPrimaryRefreshToken *> *)getPrimaryRefreshTokensForConfiguration:(MSIDConfiguration *)configuration
194194
context:(id<MSIDRequestContext>)context
195195
error:(NSError *__autoreleasing*)error
196+
{
197+
return [self getPrimaryRefreshTokensForConfiguration:configuration account:nil context:context error:error];
198+
}
199+
200+
- (NSArray<MSIDPrimaryRefreshToken *> *)getPrimaryRefreshTokensForConfiguration:(MSIDConfiguration *)configuration
201+
account:(MSIDAccountIdentifier *)accountIdentifier
202+
context:(id<MSIDRequestContext>)context
203+
error:(NSError *__autoreleasing*)error
196204
{
197205
MSIDDefaultCredentialCacheQuery *query = [MSIDDefaultCredentialCacheQuery new];
198206
query.environmentAliases = [configuration.authority defaultCacheEnvironmentAliases];
199207
query.credentialType = MSIDPrimaryRefreshTokenType;
208+
query.homeAccountId = accountIdentifier.homeAccountId;
200209

201210
NSArray<MSIDPrimaryRefreshToken *> *refreshTokens = (NSArray<MSIDPrimaryRefreshToken *> *)[self getTokensWithEnvironment:configuration.authority.environment cacheQuery:query context:context error:error];
202211
return refreshTokens;

IdentityCore/src/configuration/webview/MSIDBaseWebRequestConfiguration.h

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
#import <Foundation/Foundation.h>
2929
#import "MSIDConstants.h"
30+
#import "MSIDCustomHeaderProviding.h"
3031

3132
#if TARGET_OS_IPHONE
3233
#import <UIKit/UIKit.h>
@@ -45,6 +46,7 @@ NS_ASSUME_NONNULL_BEGIN
4546

4647
// Embedded webview
4748
@property (nonatomic, readwrite) NSDictionary<NSString *, NSString *> *customHeaders;
49+
@property (nonatomic) id<MSIDCustomHeaderProviding> customHeaderProvider; // provide extra headers for subsequent requests rather than the intial request
4850

4951
@property (nonatomic, weak) MSIDViewController *parentController;
5052
@property (nonatomic) BOOL prefersEphemeralWebBrowserSession;

IdentityCore/src/controllers/MSIDSilentController.m

+9-3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#import "MSIDTelemetryEventStrings.h"
3030
#import "MSIDTokenResult.h"
3131
#import "MSIDAccount.h"
32+
#import "MSIDAADRequestErrorHandler.h"
3233
#if TARGET_OS_IPHONE
3334
#import "MSIDBackgroundTaskManager.h"
3435
#endif
@@ -88,7 +89,7 @@ - (void)acquireToken:(nonnull MSIDRequestCompletionBlock)completionBlock
8889
MSIDRequestCompletionBlock completionBlockWrapper = ^(MSIDTokenResult * _Nullable result, NSError * _Nullable error)
8990
{
9091
#if TARGET_OS_IPHONE
91-
[[MSIDBackgroundTaskManager sharedInstance] stopOperationWithType:MSIDBackgroundTaskTypeSilentRequest];
92+
[[MSIDBackgroundTaskManager sharedInstance] stopOperationWithType:MSIDBackgroundTaskTypeSilentRequest];
9293
#endif
9394
MSID_LOG_WITH_CTX(MSIDLogLevelInfo, self.requestParameters, @"Silent flow finished. Result %@, error: %ld error domain: %@", _PII_NULLIFY(result), (long)error.code, error.domain);
9495
completionBlock(result, error);
@@ -114,7 +115,12 @@ - (void)acquireTokenWithRequest:(MSIDSilentTokenRequest *)request
114115
CONDITIONAL_START_EVENT(CONDITIONAL_SHARED_INSTANCE, self.requestParameters.telemetryRequestId, MSID_TELEMETRY_EVENT_API_EVENT);
115116
self.currentRequest = request;
116117
[request executeRequestWithCompletion:^(MSIDTokenResult *result, NSError *error)
117-
{
118+
{
119+
if (error && [MSIDAADRequestErrorHandler shouldRetryNetworkingFailure:error.code]) {
120+
completionBlock(result, error);
121+
return;
122+
}
123+
118124
if (result || !self.fallbackController)
119125
{
120126
#if !EXCLUDE_FROM_MSALCPP
@@ -123,7 +129,7 @@ - (void)acquireTokenWithRequest:(MSIDSilentTokenRequest *)request
123129
[telemetryEvent setIsExtendedLifeTimeToken:result.extendedLifeTimeToken ? MSID_TELEMETRY_VALUE_YES : MSID_TELEMETRY_VALUE_NO];
124130
if (self.isLocalFallbackMode)
125131
{
126-
[telemetryEvent setSsoExtFallBackFlow:1];
132+
[telemetryEvent setSsoExtFallBackFlow:1];
127133
}
128134

129135
[self stopTelemetryEvent:telemetryEvent error:error];

IdentityCore/src/controllers/broker/MSIDSSOExtensionSignoutController.m

+5-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#import "MSIDSSOExtensionSignoutRequest.h"
2828
#import "MSIDInteractiveRequestParameters.h"
2929
#import "ASAuthorizationSingleSignOnProvider+MSIDExtensions.h"
30+
#import "MSIDMainThreadUtil.h"
3031

3132
@interface MSIDSSOExtensionSignoutController()
3233

@@ -86,11 +87,13 @@ - (void)executeRequestWithCompletion:(MSIDSignoutRequestCompletionBlock)completi
8687
return;
8788
}
8889

90+
[MSIDMainThreadUtil executeOnMainThreadIfNeeded:^{
8991
#if TARGET_OS_IPHONE
90-
[self waitForSceneActivationAndCompleteSignout:completionBlock];
92+
[self waitForSceneActivationAndCompleteSignout:completionBlock];
9193
#else
92-
[super executeRequestWithCompletion:completionBlock];
94+
[super executeRequestWithCompletion:completionBlock];
9395
#endif
96+
}];
9497
}];
9598
}
9699

IdentityCore/src/network/error_handler/MSIDAADRequestErrorHandler.h

+2
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@
2626

2727
@interface MSIDAADRequestErrorHandler : NSObject <MSIDHttpRequestErrorHandling>
2828

29+
+ (BOOL)shouldRetryNetworkingFailure:(NSInteger)errorCode;
30+
2931
@end

IdentityCore/src/network/error_handler/MSIDAADRequestErrorHandler.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ - (void)handleError:(NSError *)error
4949
if (shouldRetry && error)
5050
{
5151
// Networking errors (-1001, -1003. -1004. -1005. -1009)
52-
shouldRetryNetworkingFailure = [self shouldRetryNetworkingFailure:error.code];
52+
shouldRetryNetworkingFailure = [MSIDAADRequestErrorHandler shouldRetryNetworkingFailure:error.code];
5353
if (shouldRetryNetworkingFailure && error.code == NSURLErrorNotConnectedToInternet)
5454
{
5555
// For handling the NSURLErrorNotConnectedToInternet error, retry the network request after a longer delay.
@@ -155,7 +155,7 @@ - (void)handleError:(NSError *)error
155155
if (completionBlock) completionBlock(nil, httpError);
156156
}
157157

158-
- (BOOL)shouldRetryNetworkingFailure:(NSInteger)errorCode
158+
+ (BOOL)shouldRetryNetworkingFailure:(NSInteger)errorCode
159159
{
160160
switch (errorCode) {
161161
case NSURLErrorTimedOut:

IdentityCore/src/oauth2/MSIDWebviewFactory.m

+2
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ @implementation MSIDWebviewFactory
229229
result[MSID_OAUTH2_STATE] = state.msidBase64UrlEncode;
230230
[result addEntriesFromDictionary:[self metadataFromRequestParameters:parameters]];
231231
[result addEntriesFromDictionary:parameters.appRequestMetadata];
232+
[result addEntriesFromDictionary:parameters.extraURLQueryParameters];
232233
return result;
233234
}
234235

@@ -301,6 +302,7 @@ - (MSIDAuthorizeWebRequestConfiguration *)authorizeWebRequestConfigurationWithRe
301302
configuration.customHeaders = parameters.customWebviewHeaders;
302303
configuration.parentController = parameters.parentViewController;
303304
configuration.prefersEphemeralWebBrowserSession = parameters.prefersEphemeralWebBrowserSession;
305+
configuration.customHeaderProvider = parameters.crossDomainHeaderProvider;
304306

305307
#if TARGET_OS_IPHONE
306308
configuration.presentationType = parameters.presentationType;

IdentityCore/src/oauth2/aad_base/MSIDAADWebviewFactory.m

+1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ @implementation MSIDAADWebviewFactory
129129
#endif
130130

131131
embeddedWebviewController.externalDecidePolicyForBrowserAction = externalDecidePolicyForBrowserAction;
132+
embeddedWebviewController.customHeaderProvider = configuration.customHeaderProvider;
132133

133134
return embeddedWebviewController;
134135
}

IdentityCore/src/parameters/MSIDInteractiveTokenRequestParameters.h

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
// THE SOFTWARE.
2323

2424
#import "MSIDInteractiveRequestParameters.h"
25+
#import "MSIDCustomHeaderProviding.h"
2526

2627
NS_ASSUME_NONNULL_BEGIN
2728

@@ -36,6 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
3637
@property (nonatomic) NSDictionary *extraAuthorizeURLQueryParameters;
3738
@property (nonatomic) BOOL enablePkce;
3839
@property (nonatomic) MSIDBrokerInvocationOptions *brokerInvocationOptions;
40+
@property (nonatomic) id<MSIDCustomHeaderProviding> crossDomainHeaderProvider;
3941

4042
- (NSOrderedSet *)allAuthorizeRequestScopes;
4143
- (NSDictionary *)allAuthorizeRequestExtraParameters DEPRECATED_MSG_ATTRIBUTE("Use -allAuthorizeRequestExtraParametersWithMetadata: instead");

IdentityCore/src/util/ios/MSIDAppExtensionUtil.m

+10-1
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,17 @@ + (void)sharedApplicationOpenURL:(NSURL*)url
8080
#if defined TARGET_OS_VISION && TARGET_OS_VISION
8181
[[self sharedApplication] openURL:url options:@{} completionHandler:nil];
8282
#else
83-
[[self sharedApplication] performSelector:NSSelectorFromString(@"openURL:") withObject:url];
83+
[self sharedApplicationOpenURL:url
84+
options:nil
85+
completionHandler:^(BOOL success)
86+
{
87+
if (!success)
88+
{
89+
MSID_LOG_WITH_CTX(MSIDLogLevelError, nil, @"Error when trying to open url: %@", [url msidPIINullifiedURL]);
90+
}
91+
}];
8492
#endif
93+
8594
}];
8695
#pragma clang diagnostic pop
8796
}

0 commit comments

Comments
 (0)