Skip to content

Commit 23c936a

Browse files
authored
Merge pull request #564 from AzureAD/release/1.3.4
Release 1.3.4
2 parents 9bcfa5e + 9ddef45 commit 23c936a

40 files changed

+587
-104
lines changed

IdentityCore/IdentityCore.xcodeproj/project.pbxproj

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@
355355
607123C2210FCAAD00B91068 /* MSIDAADAuthorityValidationRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 607123C0210FCAAD00B91068 /* MSIDAADAuthorityValidationRequest.m */; };
356356
6078EB50226DA97100235498 /* MSIDTestCacheUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 6078EB4D226DA73600235498 /* MSIDTestCacheUtil.m */; };
357357
6078EB51226DA97200235498 /* MSIDTestCacheUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 6078EB4D226DA73600235498 /* MSIDTestCacheUtil.m */; };
358+
607A788D23294D6F00A1F74D /* MSIDAccountMetadataCacheAccessorMock.m in Sources */ = {isa = PBXBuildFile; fileRef = 607A788C23294D6F00A1F74D /* MSIDAccountMetadataCacheAccessorMock.m */; };
359+
607A788E23294D6F00A1F74D /* MSIDAccountMetadataCacheAccessorMock.m in Sources */ = {isa = PBXBuildFile; fileRef = 607A788C23294D6F00A1F74D /* MSIDAccountMetadataCacheAccessorMock.m */; };
358360
609E74BD228CA5CA005E3FED /* MSIDAccountMetadataCacheAccessor.m in Sources */ = {isa = PBXBuildFile; fileRef = 609E74BC228CA5CA005E3FED /* MSIDAccountMetadataCacheAccessor.m */; };
359361
609E74BE228CA5CA005E3FED /* MSIDAccountMetadataCacheAccessor.m in Sources */ = {isa = PBXBuildFile; fileRef = 609E74BC228CA5CA005E3FED /* MSIDAccountMetadataCacheAccessor.m */; };
360362
609E74C1228CC50E005E3FED /* MSIDMetadataCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 609E74C0228CC50E005E3FED /* MSIDMetadataCache.m */; };
@@ -681,6 +683,11 @@
681683
B251CC4C204105A7005E0179 /* MSIDIdToken.m in Sources */ = {isa = PBXBuildFile; fileRef = B251CC46204105A7005E0179 /* MSIDIdToken.m */; };
682684
B251CC4D204105A7005E0179 /* MSIDIdToken.m in Sources */ = {isa = PBXBuildFile; fileRef = B251CC46204105A7005E0179 /* MSIDIdToken.m */; };
683685
B251CC51204105AE005E0179 /* MSIDCredentialType.m in Sources */ = {isa = PBXBuildFile; fileRef = B251CC4F204105AD005E0179 /* MSIDCredentialType.m */; };
686+
B2525C6A23302364006FBA4B /* MSIDMainThreadUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = B2525C6823302364006FBA4B /* MSIDMainThreadUtil.h */; };
687+
B2525C6B23302364006FBA4B /* MSIDMainThreadUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = B2525C6923302364006FBA4B /* MSIDMainThreadUtil.m */; };
688+
B2525C6C23302364006FBA4B /* MSIDMainThreadUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = B2525C6923302364006FBA4B /* MSIDMainThreadUtil.m */; };
689+
B2525C752330623E006FBA4B /* MSIDMainThreadUtilTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B2525C742330623E006FBA4B /* MSIDMainThreadUtilTests.m */; };
690+
B2525C762330623E006FBA4B /* MSIDMainThreadUtilTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B2525C742330623E006FBA4B /* MSIDMainThreadUtilTests.m */; };
684691
B252913B2096698100E78695 /* MSIDAADIdTokenClaimsFactoryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B252913A2096698100E78695 /* MSIDAADIdTokenClaimsFactoryTests.m */; };
685692
B252913C2096698100E78695 /* MSIDAADIdTokenClaimsFactoryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B252913A2096698100E78695 /* MSIDAADIdTokenClaimsFactoryTests.m */; };
686693
B253BD7A20487C8A00D07F31 /* MSIDLegacyTokenCacheIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B23ECF041FF33AE70015FC1D /* MSIDLegacyTokenCacheIntegrationTests.m */; };
@@ -1505,6 +1512,8 @@
15051512
607123C0210FCAAD00B91068 /* MSIDAADAuthorityValidationRequest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDAADAuthorityValidationRequest.m; sourceTree = "<group>"; };
15061513
6078EB4C226DA71100235498 /* MSIDTestCacheUtil.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDTestCacheUtil.h; sourceTree = "<group>"; };
15071514
6078EB4D226DA73600235498 /* MSIDTestCacheUtil.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDTestCacheUtil.m; sourceTree = "<group>"; };
1515+
607A788B23294D2400A1F74D /* MSIDAccountMetadataCacheAccessorMock.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDAccountMetadataCacheAccessorMock.h; sourceTree = "<group>"; };
1516+
607A788C23294D6F00A1F74D /* MSIDAccountMetadataCacheAccessorMock.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDAccountMetadataCacheAccessorMock.m; sourceTree = "<group>"; };
15081517
609E74BB228CA5A8005E3FED /* MSIDAccountMetadataCacheAccessor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDAccountMetadataCacheAccessor.h; sourceTree = "<group>"; };
15091518
609E74BC228CA5CA005E3FED /* MSIDAccountMetadataCacheAccessor.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDAccountMetadataCacheAccessor.m; sourceTree = "<group>"; };
15101519
609E74BF228CC501005E3FED /* MSIDMetadataCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDMetadataCache.h; sourceTree = "<group>"; };
@@ -1548,6 +1557,7 @@
15481557
960F915620CB4ABC0055A162 /* MSIDAADWebviewFactory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDAADWebviewFactory.h; sourceTree = "<group>"; };
15491558
960F915720CB4ABC0055A162 /* MSIDAADWebviewFactory.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDAADWebviewFactory.m; sourceTree = "<group>"; };
15501559
960F918920CBECAE0055A162 /* MSIDAADWebviewFactoryTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDAADWebviewFactoryTests.m; sourceTree = "<group>"; };
1560+
9621605322FF4FCD00DF5D9A /* MSIDURLResponseHandling.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDURLResponseHandling.h; sourceTree = "<group>"; };
15511561
96235F94207D7286007EAB36 /* MSIDWebOAuth2Response.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDWebOAuth2Response.h; sourceTree = "<group>"; };
15521562
96235F95207D7286007EAB36 /* MSIDWebOAuth2Response.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDWebOAuth2Response.m; sourceTree = "<group>"; };
15531563
96235F97207D72A6007EAB36 /* MSIDWebAADAuthResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDWebAADAuthResponse.h; sourceTree = "<group>"; };
@@ -1753,6 +1763,9 @@
17531763
B251CC4F204105AD005E0179 /* MSIDCredentialType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSIDCredentialType.m; sourceTree = "<group>"; };
17541764
B251CC53204109A4005E0179 /* MSIDCredentialCacheItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDCredentialCacheItem.h; sourceTree = "<group>"; };
17551765
B251CC54204109A4005E0179 /* MSIDCredentialCacheItem.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDCredentialCacheItem.m; sourceTree = "<group>"; };
1766+
B2525C6823302364006FBA4B /* MSIDMainThreadUtil.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSIDMainThreadUtil.h; sourceTree = "<group>"; };
1767+
B2525C6923302364006FBA4B /* MSIDMainThreadUtil.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDMainThreadUtil.m; sourceTree = "<group>"; };
1768+
B2525C742330623E006FBA4B /* MSIDMainThreadUtilTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDMainThreadUtilTests.m; sourceTree = "<group>"; };
17561769
B252913A2096698100E78695 /* MSIDAADIdTokenClaimsFactoryTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDAADIdTokenClaimsFactoryTests.m; sourceTree = "<group>"; };
17571770
B2544EEA21684B2B00B4C108 /* MSIDCacheSchemaValidationTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDCacheSchemaValidationTests.m; sourceTree = "<group>"; };
17581771
B2561221217EA93800999876 /* MSIDB2COauth2FactoryTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSIDB2COauth2FactoryTests.m; sourceTree = "<group>"; };
@@ -2379,10 +2392,14 @@
23792392
B2BE926421A25F7200F5AB8C /* MSIDTestBrokerResponseHandler.m */,
23802393
B2BE926A21A2620400F5AB8C /* MSIDTestBrokerTokenRequest.h */,
23812394
B2BE926B21A2620400F5AB8C /* MSIDTestBrokerTokenRequest.m */,
2395+
964E669420AE97FD00857009 /* MSIDTestWebviewInteractingViewController.h */,
2396+
964E669520AE97FD00857009 /* MSIDTestWebviewInteractingViewController.m */,
23822397
23CA0C60220A6DF600768729 /* MSIDRegistrationInformationMock.h */,
23832398
23CA0C61220A6DF600768729 /* MSIDRegistrationInformationMock.m */,
23842399
B2968CA222F67AAF005AFC33 /* MSIDTestLocalInteractiveController.h */,
23852400
B2968CA322F67AAF005AFC33 /* MSIDTestLocalInteractiveController.m */,
2401+
607A788B23294D2400A1F74D /* MSIDAccountMetadataCacheAccessorMock.h */,
2402+
607A788C23294D6F00A1F74D /* MSIDAccountMetadataCacheAccessorMock.m */,
23862403
);
23872404
path = mocks;
23882405
sourceTree = "<group>";
@@ -2625,6 +2642,8 @@
26252642
96C998EE20B638F60053A2D9 /* MSIDWebviewSession.m */,
26262643
96F21B2F20A65896002B87C3 /* MSIDWebviewAuthorization.h */,
26272644
96F21B3020A65896002B87C3 /* MSIDWebviewAuthorization.m */,
2645+
B2525C6823302364006FBA4B /* MSIDMainThreadUtil.h */,
2646+
B2525C6923302364006FBA4B /* MSIDMainThreadUtil.m */,
26282647
);
26292648
path = webview;
26302649
sourceTree = "<group>";
@@ -3053,6 +3072,7 @@
30533072
children = (
30543073
96A3E9B7208941D700BE5262 /* MSIDSystemWebviewController.h */,
30553074
96A3E9B8208941D700BE5262 /* MSIDSystemWebviewController.m */,
3075+
9621605322FF4FCD00DF5D9A /* MSIDURLResponseHandling.h */,
30563076
960196F7208E578900D962D3 /* MSIDAuthenticationSession.h */,
30573077
960196F8208E578900D962D3 /* MSIDAuthenticationSession.m */,
30583078
960196FA208E579600D962D3 /* MSIDSafariViewController.h */,
@@ -3544,8 +3564,6 @@
35443564
D626FFEA1FBD200A00EE4487 /* network */,
35453565
2338ECD4208A7B3200809B9E /* MSIDTestContext.h */,
35463566
2338ECD5208A7B3200809B9E /* MSIDTestContext.m */,
3547-
964E669420AE97FD00857009 /* MSIDTestWebviewInteractingViewController.h */,
3548-
964E669520AE97FD00857009 /* MSIDTestWebviewInteractingViewController.m */,
35493567
B28AC66221A0BB9D00A1FC4A /* MSIDTestBrokerResponseHelper.h */,
35503568
B28AC66321A0BB9D00A1FC4A /* MSIDTestBrokerResponseHelper.m */,
35513569
B28AC66721A0C07A00A1FC4A /* MSIDTestBrokerKeyProviderHelper.h */,
@@ -3796,6 +3814,8 @@
37963814
B27CCDD4229EF2C000CAD565 /* MSIDDictionaryExtensionsTests.m */,
37973815
B223B0A222ADEE4500FB8713 /* MSIDMaskedUsernameLogParameterTests.m */,
37983816
B223B0A522ADEE5900FB8713 /* MSIDMaskedLogParameterTests.m */,
3817+
B203197E217BF191006488D0 /* MSIDClientCapabilitiesTests.m */,
3818+
B2525C742330623E006FBA4B /* MSIDMainThreadUtilTests.m */,
37993819
);
38003820
path = tests;
38013821
sourceTree = "<group>";
@@ -4055,6 +4075,7 @@
40554075
B20657DF1FCA208C00412B7D /* NSDate+MSIDExtensions.h in Headers */,
40564076
96090D9820E59B2000E42B37 /* MSIDNotifications.h in Headers */,
40574077
96F94A3320817C1A0034676C /* MSIDNTLMHandler.h in Headers */,
4078+
B2525C6A23302364006FBA4B /* MSIDMainThreadUtil.h in Headers */,
40584079
B297E1E620A12BDE00F370EC /* MSIDDefaultAccountCacheKey.h in Headers */,
40594080
B2DFA56F231E0649006F9EF8 /* MSIDKeychainTokenCache.h in Headers */,
40604081
B2C7088D2198E48E00D917B8 /* NSData+AES.h in Headers */,
@@ -4637,6 +4658,7 @@
46374658
960F915220CB00C10055A162 /* MSIDAADV2WebviewFactoryTests.m in Sources */,
46384659
963553BF20CA7C52005235E5 /* MSIDSystemWebviewControllerTests.m in Sources */,
46394660
963CFAF320AD817600BDA25F /* MSIDWebviewAuthorizationTests.m in Sources */,
4661+
B2525C752330623E006FBA4B /* MSIDMainThreadUtilTests.m in Sources */,
46404662
2338ECDA208A7CBD00809B9E /* MSIDAADRequestErrorHandlerTests.m in Sources */,
46414663
23CA0C4A220A3B6900768729 /* MSIDPKeyAuthHandlerTests.m in Sources */,
46424664
B223B0A622ADEE5900FB8713 /* MSIDMaskedLogParameterTests.m in Sources */,
@@ -4814,6 +4836,7 @@
48144836
B20657E11FCA208C00412B7D /* NSDate+MSIDExtensions.m in Sources */,
48154837
B27551C22081705300AA7A38 /* MSIDJWTHelper.m in Sources */,
48164838
B251CC1D2040F6B5005E0179 /* MSIDLegacyTokenCacheKey.m in Sources */,
4839+
B2525C6C23302364006FBA4B /* MSIDMainThreadUtil.m in Sources */,
48174840
2306D2A020AB672A00F875A3 /* MSIDAADEndpointProvider.m in Sources */,
48184841
B251CC4B204105A7005E0179 /* MSIDBaseToken.m in Sources */,
48194842
235480D120DDF81000246F72 /* MSIDADFSAuthority.m in Sources */,
@@ -4977,6 +5000,7 @@
49775000
B281B339226BBB1C009619AB /* MSIDOAuthRequestConfiguratorTests.m in Sources */,
49785001
B2808005204CB2A700944D89 /* MSIDAADV1TokenResponseTests.m in Sources */,
49795002
D6D9A4BD1FBE712900EFA430 /* MSIDURLExtensionsTests.m in Sources */,
5003+
B2525C762330623E006FBA4B /* MSIDMainThreadUtilTests.m in Sources */,
49805004
960F918B20CBECAE0055A162 /* MSIDAADWebviewFactoryTests.m in Sources */,
49815005
238A047A2088561100989EE0 /* MSIDHttpRequestIntegrationTests.m in Sources */,
49825006
963CFAF420AD817600BDA25F /* MSIDWebviewAuthorizationTests.m in Sources */,
@@ -5051,6 +5075,7 @@
50515075
963E68E721489A9500D7D0CC /* NSString+MSIDTestUtil.m in Sources */,
50525076
23185368206D8B1D0024DCA4 /* MSIDTestTokenResponse.m in Sources */,
50535077
961ACDFD22A1F60800B9266C /* NSData+MSIDTestUtil.m in Sources */,
5078+
607A788D23294D6F00A1F74D /* MSIDAccountMetadataCacheAccessorMock.m in Sources */,
50545079
B2BE925421A24B8200F5AB8C /* MSIDTestTokenRequestProvider.m in Sources */,
50555080
23FB5C3A225588D0002BF1EB /* MSIDClaimsRequestMock.m in Sources */,
50565081
B2BE926921A25F8300F5AB8C /* MSIDTestBrokerResponseHandler.m in Sources */,
@@ -5085,6 +5110,7 @@
50855110
D626FFF51FBD200A00EE4487 /* MSIDTestURLSession.m in Sources */,
50865111
969CCB5822A9EB7D00A55515 /* MSIDTestCacheDataSource.m in Sources */,
50875112
96290E5721489BB800FDD5C8 /* NSString+MSIDTestUtil.m in Sources */,
5113+
607A788E23294D6F00A1F74D /* MSIDAccountMetadataCacheAccessorMock.m in Sources */,
50885114
D6D9A44E1FBD3EEA00EFA430 /* NSDictionary+MSIDTestUtil.m in Sources */,
50895115
23FB5C39225588CF002BF1EB /* MSIDClaimsRequestMock.m in Sources */,
50905116
B245C2FB2106ABDC00CD5A52 /* MSIDTestIdTokenUtil.m in Sources */,
@@ -5281,6 +5307,7 @@
52815307
23B39ACC209CF317000AA905 /* MSIDAADNetworkConfiguration.m in Sources */,
52825308
2321531B1FDA101900C6960D /* MSIDUserInformation.m in Sources */,
52835309
232C65842138BD11002A41FE /* MSIDAADAuthorityMetadataResponseSerializer.m in Sources */,
5310+
B2525C6B23302364006FBA4B /* MSIDMainThreadUtil.m in Sources */,
52845311
B23ECEEB1FF2F56A0015FC1D /* MSIDAADTokenResponse.m in Sources */,
52855312
B28D90AB218FD1F800E230D6 /* MSIDDefaultTokenResponseValidator.m in Sources */,
52865313
B28BDA80217E964B003E5670 /* MSIDB2CTokenResponse.m in Sources */,

IdentityCore/src/controllers/ios/MSIDBrokerInteractiveController.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#import "MSIDAccountIdentifier.h"
4242
#import "MSIDAuthority.h"
4343
#import "MSIDBrokerInvocationOptions.h"
44+
#import "MSIDMainThreadUtil.h"
4445

4546
@interface MSIDBrokerInteractiveController()
4647

@@ -227,10 +228,10 @@ - (void)callBrokerWithRequest:(MSIDBrokerTokenRequest *)brokerRequest
227228
}
228229
else
229230
{
230-
dispatch_async(dispatch_get_main_queue(), ^{
231+
[MSIDMainThreadUtil executeOnMainThreadIfNeeded:^{
231232
[MSIDNotifications notifyWebAuthWillSwitchToBroker];
232233
[self openBrokerWithRequestURL:launchURL fallbackToLocalController:!firstTimeInstall];
233-
});
234+
}];
234235
}
235236
}
236237

IdentityCore/src/network/error_handler/MSIDAADRequestErrorHandler.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@
2828
#import "MSIDAADTokenResponse.h"
2929
#import "MSIDWorkPlaceJoinConstants.h"
3030
#import "MSIDPKeyAuthHandler.h"
31+
#import "MSIDMainThreadUtil.h"
3132

3233
@implementation MSIDAADRequestErrorHandler
3334

3435
- (void)handleError:(NSError *)error
3536
httpResponse:(NSHTTPURLResponse *)httpResponse
3637
data:(NSData *)data
37-
httpRequest:(id<MSIDHttpRequestProtocol>)httpRequest
38+
httpRequest:(NSObject<MSIDHttpRequestProtocol> *)httpRequest
3839
responseSerializer:(id<MSIDResponseSerialization>)responseSerializer
3940
context:(id<MSIDRequestContext>)context
4041
completionBlock:(MSIDHttpRequestDidCompleteBlock)completionBlock

IdentityCore/src/network/error_handler/MSIDHttpRequestErrorHandling.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
- (void)handleError:(NSError * )error
3131
httpResponse:(NSHTTPURLResponse *)httpResponse
3232
data:(NSData *)data
33-
httpRequest:(id<MSIDHttpRequestProtocol>)httpRequest
33+
httpRequest:(NSObject<MSIDHttpRequestProtocol> *)httpRequest
3434
responseSerializer:(id<MSIDResponseSerialization>)responseSerializer
3535
context:(id<MSIDRequestContext>)context
3636
completionBlock:(MSIDHttpRequestDidCompleteBlock)completionBlock;

IdentityCore/src/oauth2/MSIDWebviewFactory.m

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ @implementation MSIDWebviewFactory
4747

4848
- (MSIDWebviewSession *)embeddedWebviewSessionFromConfiguration:(MSIDWebviewConfiguration *)configuration customWebview:(WKWebView *)webview context:(id<MSIDRequestContext>)context
4949
{
50+
if (![NSThread isMainThread])
51+
{
52+
__block MSIDWebviewSession *session;
53+
dispatch_sync(dispatch_get_main_queue(), ^{
54+
session = [self embeddedWebviewSessionFromConfiguration:configuration customWebview:webview context:context];
55+
});
56+
57+
return session;
58+
}
59+
5060
NSString *state = [self generateStateValue];
5161
NSURL *startURL = [self startURLFromConfiguration:configuration requestState:state];
5262
NSURL *redirectURL = [NSURL URLWithString:configuration.redirectUri];
@@ -80,12 +90,23 @@ - (MSIDWebviewSession *)systemWebviewSessionFromConfiguration:(MSIDWebviewConfig
8090
allowSafariViewController:(BOOL)allowSafariViewController
8191
context:(id<MSIDRequestContext>)context
8292
{
93+
if (![NSThread isMainThread])
94+
{
95+
__block MSIDWebviewSession *session;
96+
dispatch_sync(dispatch_get_main_queue(), ^{
97+
session = [self systemWebviewSessionFromConfiguration:configuration
98+
useAuthenticationSession:useAuthenticationSession
99+
allowSafariViewController:allowSafariViewController
100+
context:context];
101+
});
102+
103+
return session;
104+
}
105+
83106
NSString *state = [self generateStateValue];
84107
NSURL *startURL = [self startURLFromConfiguration:configuration requestState:state];
85-
NSURL *redirectURL = [NSURL URLWithString:configuration.redirectUri];
86-
87108
MSIDSystemWebviewController *systemWVC = [[MSIDSystemWebviewController alloc] initWithStartURL:startURL
88-
callbackURLScheme:redirectURL.scheme
109+
redirectURI:configuration.redirectUri
89110
parentController:configuration.parentController
90111
presentationType:configuration.presentationType
91112
useAuthenticationSession:useAuthenticationSession

IdentityCore/src/requests/sdk/MSIDTokenResponseValidator.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,9 @@ - (MSIDTokenResult *)validateAndSaveTokenResponse:(MSIDTokenResponse *)tokenResp
251251
MSIDAuthority *resultingAuthority = [factory resultAuthorityWithConfiguration:parameters.msidConfiguration tokenResponse:tokenResponse error:&updateMetadataError];
252252
if (resultingAuthority && !updateMetadataError)
253253
{
254+
MSIDAuthority *providedAuthority = parameters.providedAuthority ?: parameters.authority;
254255
[accountMetadataCache updateAuthorityURL:resultingAuthority.url
255-
forRequestURL:parameters.authority.url
256+
forRequestURL:providedAuthority.url
256257
homeAccountId:tokenResult.account.accountIdentifier.homeAccountId
257258
clientId:parameters.clientId
258259
instanceAware:parameters.instanceAware

IdentityCore/src/util/NSKeyedArchiver+MSIDExtensions.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ + (NSData *)msidEncodeObject:(nullable id)obj usingBlock:(void (^)(NSKeyedArchiv
3333
{
3434
archiver = [[NSKeyedArchiver alloc] initRequiringSecureCoding:YES];
3535
}
36-
#if !TARGET_OS_UIKITFORMAC
36+
#if !TARGET_OS_MACCATALYST
3737
else
3838
{
3939
archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
@@ -67,7 +67,7 @@ + (NSData *)msidArchivedDataWithRootObject:(id)object
6767
{
6868
result = [NSKeyedArchiver archivedDataWithRootObject:object requiringSecureCoding:requiresSecureCoding error:error];
6969
}
70-
#if !TARGET_OS_UIKITFORMAC
70+
#if !TARGET_OS_MACCATALYST
7171
else
7272
{
7373
result = [NSKeyedArchiver archivedDataWithRootObject:object];

0 commit comments

Comments
 (0)