Skip to content

Commit 6eaee12

Browse files
authored
[macOS SDK] Update macOS minimum version to 10.15 (#2220)
* Increased minimum macOS version to 10.15 * Removed all instances of if (@available(macOS 10.15, *)) * Updated CHANGELOG.md * Corrected version * Removed all API_AVAILABLE that were always satisfied Removed all if (@available) that were always satisfied * Reverted to dev IdentityCore * New IdentityCore * New Idenitycore * Updated IdenityCore to correct version * PR comments * Latest IdentityCore * Updated IdentityCore * Using dev branch after merge
1 parent da3067f commit 6eaee12

18 files changed

+121
-183
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## [TBD]:
2+
* Increased macOS minimum version to 10.15 #2220
3+
14
## [1.4.1]
25
* Update Native Auth logging levels for improved clarity and consistency. (#2184)
36
* Update common core submodule with changes related to upgrade registration. (#2180)

MSAL/IdentityCore

Submodule IdentityCore updated 60 files

MSAL/MSAL.xcodeproj/project.pbxproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6427,7 +6427,7 @@
64276427
COPY_PHASE_STRIP = NO;
64286428
GCC_DYNAMIC_NO_PIC = NO;
64296429
GCC_OPTIMIZATION_LEVEL = 0;
6430-
MACOSX_DEPLOYMENT_TARGET = 10.13;
6430+
MACOSX_DEPLOYMENT_TARGET = 10.15;
64316431
PRODUCT_NAME = "MSAL (macOS Static Library)";
64326432
};
64336433
name = Debug;
@@ -6438,7 +6438,7 @@
64386438
buildSettings = {
64396439
COPY_PHASE_STRIP = YES;
64406440
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
6441-
MACOSX_DEPLOYMENT_TARGET = 10.13;
6441+
MACOSX_DEPLOYMENT_TARGET = 10.15;
64426442
PRODUCT_NAME = "MSAL (macOS Static Library)";
64436443
};
64446444
name = Release;
@@ -6499,7 +6499,7 @@
64996499
"$(inherited)",
65006500
"@executable_path/../Frameworks",
65016501
);
6502-
MACOSX_DEPLOYMENT_TARGET = 10.13;
6502+
MACOSX_DEPLOYMENT_TARGET = 10.15;
65036503
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
65046504
MTL_FAST_MATH = YES;
65056505
ONLY_ACTIVE_ARCH = YES;
@@ -6569,7 +6569,7 @@
65696569
"$(inherited)",
65706570
"@executable_path/../Frameworks",
65716571
);
6572-
MACOSX_DEPLOYMENT_TARGET = 10.13;
6572+
MACOSX_DEPLOYMENT_TARGET = 10.15;
65736573
MTL_ENABLE_DEBUG_INFO = NO;
65746574
MTL_FAST_MATH = YES;
65756575
PRODUCT_BUNDLE_IDENTIFIER = com.microsoft.MSALMacTestApp;
@@ -6981,7 +6981,7 @@
69816981
"$(inherited)",
69826982
"@executable_path/../Frameworks",
69836983
);
6984-
MACOSX_DEPLOYMENT_TARGET = 10.13;
6984+
MACOSX_DEPLOYMENT_TARGET = 10.15;
69856985
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
69866986
MTL_FAST_MATH = YES;
69876987
ONLY_ACTIVE_ARCH = YES;
@@ -7045,7 +7045,7 @@
70457045
"$(inherited)",
70467046
"@executable_path/../Frameworks",
70477047
);
7048-
MACOSX_DEPLOYMENT_TARGET = 10.13;
7048+
MACOSX_DEPLOYMENT_TARGET = 10.15;
70497049
MTL_ENABLE_DEBUG_INFO = NO;
70507050
MTL_FAST_MATH = YES;
70517051
PRODUCT_BUNDLE_IDENTIFIER = "com.microsoft.unit-test-host";
@@ -7460,7 +7460,7 @@
74607460
"@executable_path/../Frameworks",
74617461
"@loader_path/Frameworks",
74627462
);
7463-
MACOSX_DEPLOYMENT_TARGET = 10.13;
7463+
MACOSX_DEPLOYMENT_TARGET = 10.15;
74647464
MARKETING_VERSION = 1.1.24;
74657465
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
74667466
SWIFT_VERSION = 5.0;
@@ -7481,7 +7481,7 @@
74817481
"@executable_path/../Frameworks",
74827482
"@loader_path/Frameworks",
74837483
);
7484-
MACOSX_DEPLOYMENT_TARGET = 10.13;
7484+
MACOSX_DEPLOYMENT_TARGET = 10.15;
74857485
MARKETING_VERSION = 1.1.24;
74867486
SWIFT_VERSION = 5.0;
74877487
};
@@ -7556,7 +7556,7 @@
75567556
CODE_SIGN_STYLE = Manual;
75577557
DEVELOPMENT_TEAM = "";
75587558
GCC_OPTIMIZATION_LEVEL = 0;
7559-
MACOSX_DEPLOYMENT_TARGET = 10.13;
7559+
MACOSX_DEPLOYMENT_TARGET = 10.15;
75607560
PROVISIONING_PROFILE_SPECIFIER = "";
75617561
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/unit-test-host-mac.app/Contents/MacOS/unit-test-host-mac";
75627562
USER_HEADER_SEARCH_PATHS = (
@@ -7574,7 +7574,7 @@
75747574
buildSettings = {
75757575
CODE_SIGN_STYLE = Manual;
75767576
DEVELOPMENT_TEAM = "";
7577-
MACOSX_DEPLOYMENT_TARGET = 10.13;
7577+
MACOSX_DEPLOYMENT_TARGET = 10.15;
75787578
PROVISIONING_PROFILE_SPECIFIER = "";
75797579
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/unit-test-host-mac.app/Contents/MacOS/unit-test-host-mac";
75807580
USER_HEADER_SEARCH_PATHS = (

MSAL/src/MSALDeviceInformation.m

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,7 @@ - (instancetype)init
5454
_deviceMode = MSALDeviceModeDefault;
5555
_extraDeviceInformation = [NSMutableDictionary new];
5656

57-
if (@available(macOS 10.15, *))
58-
{
59-
_hasAADSSOExtension = [[ASAuthorizationSingleSignOnProvider msidSharedProvider] canPerformAuthorization];
60-
}
61-
else
62-
{
63-
_hasAADSSOExtension = NO;
64-
}
57+
_hasAADSSOExtension = [[ASAuthorizationSingleSignOnProvider msidSharedProvider] canPerformAuthorization];
6558
}
6659

6760
return self;
@@ -75,14 +68,7 @@ - (instancetype)initWithMSIDDeviceInfo:(MSIDDeviceInfo *)deviceInfo
7568
{
7669
_deviceMode = [self msalDeviceModeFromMSIDMode:deviceInfo.deviceMode];
7770

78-
if (@available(macOS 10.15, *))
79-
{
80-
_hasAADSSOExtension = [[ASAuthorizationSingleSignOnProvider msidSharedProvider] canPerformAuthorization];
81-
}
82-
else
83-
{
84-
_hasAADSSOExtension = NO;
85-
}
71+
_hasAADSSOExtension = [[ASAuthorizationSingleSignOnProvider msidSharedProvider] canPerformAuthorization];
8672

8773
#if TARGET_OS_OSX
8874
_platformSSOStatus = [self msalPlatformSSOStatusFromMSIDPlatformSSOStatus:deviceInfo.platformSSOStatus];

MSAL/src/MSALPublicClientApplication.m

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -320,30 +320,19 @@ - (BOOL)setupTokenCacheWithConfiguration:(MSALPublicClientApplicationConfig *)co
320320
id<MSIDExtendedTokenCacheDataSource> dataSource = nil;
321321
id<MSIDExtendedTokenCacheDataSource> secondaryDataSource = nil;
322322
NSError *dataSourceError = nil;
323-
324-
if (@available(macOS 10.15, *)) {
325-
dataSource = [[MSIDKeychainTokenCache alloc] initWithGroup:config.cacheConfig.keychainSharingGroup error:&dataSourceError];
326-
327-
self.msidCacheConfig = [[MSIDCacheConfig alloc] initWithKeychainGroup:config.cacheConfig.keychainSharingGroup];
328-
329-
NSError *secondaryDataSourceError = nil;
330-
secondaryDataSource = [[MSIDMacKeychainTokenCache alloc] initWithGroup:config.cacheConfig.keychainSharingGroup
331-
trustedApplications:config.cacheConfig.trustedApplications
332-
error:&secondaryDataSourceError];
333-
334-
if (secondaryDataSourceError)
335-
{
336-
MSID_LOG_WITH_CTX_PII(MSIDLogLevelWarning, nil, @"Failed to create secondary data source with error %@", MSID_PII_LOG_MASKABLE(secondaryDataSourceError));
337-
}
338-
}
339-
else
323+
324+
dataSource = [[MSIDKeychainTokenCache alloc] initWithGroup:config.cacheConfig.keychainSharingGroup error:&dataSourceError];
325+
326+
self.msidCacheConfig = [[MSIDCacheConfig alloc] initWithKeychainGroup:config.cacheConfig.keychainSharingGroup];
327+
328+
NSError *secondaryDataSourceError = nil;
329+
secondaryDataSource = [[MSIDMacKeychainTokenCache alloc] initWithGroup:config.cacheConfig.keychainSharingGroup
330+
trustedApplications:config.cacheConfig.trustedApplications
331+
error:&secondaryDataSourceError];
332+
333+
if (secondaryDataSourceError)
340334
{
341-
MSIDMacKeychainTokenCache *macDataSource = [[MSIDMacKeychainTokenCache alloc] initWithGroup:config.cacheConfig.keychainSharingGroup
342-
trustedApplications:config.cacheConfig.trustedApplications
343-
error:&dataSourceError];
344-
345-
dataSource = macDataSource;
346-
self.msidCacheConfig = [[MSIDCacheConfig alloc] initWithKeychainGroup:config.cacheConfig.keychainSharingGroup accessRef:(__bridge SecAccessRef _Nullable)(macDataSource.accessControlForNonSharedItems)];
335+
MSID_LOG_WITH_CTX_PII(MSIDLogLevelWarning, nil, @"Failed to create secondary data source with error %@", MSID_PII_LOG_MASKABLE(secondaryDataSourceError));
347336
}
348337

349338
if (!dataSource)

MSAL/src/MSIDInteractiveRequestParameters+MSALRequest.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,7 @@ - (BOOL)fillWithWebViewParameters:(MSALWebviewParameters *)webParameters
6060

6161
self.parentViewController = parentViewController;
6262

63-
if (@available(macOS 10.15, *))
64-
{
65-
self.prefersEphemeralWebBrowserSession = webParameters.prefersEphemeralWebBrowserSession;
66-
}
63+
self.prefersEphemeralWebBrowserSession = webParameters.prefersEphemeralWebBrowserSession;
6764

6865
// Configure webview
6966
#pragma clang diagnostic push

MSAL/src/configuration/MSALWebviewParameters.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,7 @@ - (id)copyWithZone:(__unused NSZone *)zone
6868
item.presentationStyle = _presentationStyle;
6969
#endif
7070

71-
if (@available(macOS 10.15, *))
72-
{
73-
item.prefersEphemeralWebBrowserSession = _prefersEphemeralWebBrowserSession;
74-
}
71+
item.prefersEphemeralWebBrowserSession = _prefersEphemeralWebBrowserSession;
7572

7673
item.webviewType = _webviewType;
7774
item.customWebview = _customWebview;

MSAL/src/instance/MSALAccountsProvider.m

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,7 @@ - (void)allAccountsFromDevice:(MSALAccountEnumerationParameters *)parameters
350350
{
351351
BOOL shouldCallBroker = NO;
352352

353-
if (@available(macOS 10.15, *))
354-
{
355-
shouldCallBroker = [MSIDSSOExtensionGetAccountsRequest canPerformRequest] && [requestParameters shouldUseBroker];
356-
}
353+
shouldCallBroker = [MSIDSSOExtensionGetAccountsRequest canPerformRequest] && [requestParameters shouldUseBroker];
357354

358355
if (!shouldCallBroker)
359356
{
@@ -363,17 +360,14 @@ - (void)allAccountsFromDevice:(MSALAccountEnumerationParameters *)parameters
363360
return;
364361
}
365362

366-
if (@available(macOS 10.15, *))
367-
{
368-
[self allAccountsFromSSOExtension:parameters
363+
[self allAccountsFromSSOExtension:parameters
369364
requestParameters:requestParameters
370365
completionBlock:completionBlock];
371-
}
372366
}
373367

374368
- (void)allAccountsFromSSOExtension:(MSALAccountEnumerationParameters *)parameters
375369
requestParameters:(MSIDRequestParameters *)requestParameters
376-
completionBlock:(MSALAccountsCompletionBlock)completionBlock API_AVAILABLE(ios(13.0), macos(10.15))
370+
completionBlock:(MSALAccountsCompletionBlock)completionBlock
377371
{
378372
NSError *requestError;
379373
MSIDSSOExtensionGetAccountsRequest *ssoExtensionRequest = [[MSIDSSOExtensionGetAccountsRequest alloc] initWithRequestParameters:requestParameters

MSAL/src/instance/MSALDeviceInfoProvider.m

Lines changed: 35 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,7 @@ - (void)deviceInfoWithRequestParameters:(MSIDRequestParameters *)requestParamete
6868
}
6969

7070
BOOL canCallSSOExtension = NO;
71-
if (@available(macOS 10.15, *))
72-
{
73-
canCallSSOExtension = [MSIDSSOExtensionGetDeviceInfoRequest canPerformRequest];
74-
}
71+
canCallSSOExtension = [MSIDSSOExtensionGetDeviceInfoRequest canPerformRequest];
7572

7673
MSID_LOG_WITH_CTX(MSIDLogLevelInfo, requestParameters, @"GetDeviceInfo: Should call Sso Extension decision: %i", canCallSSOExtension);
7774
if (!canCallSSOExtension)
@@ -81,49 +78,46 @@ - (void)deviceInfoWithRequestParameters:(MSIDRequestParameters *)requestParamete
8178
fillDeviceInfoCompletionBlock(nil, nil);
8279
return;
8380
}
84-
85-
if (@available(macOS 10.15, *))
81+
82+
// We are here means canCallSSOExtension is TRUE
83+
MSID_LOG_WITH_CTX(MSIDLogLevelVerbose, requestParameters, @"GetDeviceInfo: Creating Sso Extension request");
84+
NSError *requestError;
85+
MSIDSSOExtensionGetDeviceInfoRequest *ssoExtensionRequest = [[MSIDSSOExtensionGetDeviceInfoRequest alloc] initWithRequestParameters:requestParameters
86+
error:&requestError];
87+
if (!ssoExtensionRequest)
8688
{
87-
// We are here means canCallSSOExtension is TRUE
88-
MSID_LOG_WITH_CTX(MSIDLogLevelVerbose, requestParameters, @"GetDeviceInfo: Creating Sso Extension request");
89-
NSError *requestError;
90-
MSIDSSOExtensionGetDeviceInfoRequest *ssoExtensionRequest = [[MSIDSSOExtensionGetDeviceInfoRequest alloc] initWithRequestParameters:requestParameters
91-
error:&requestError];
92-
if (!ssoExtensionRequest)
93-
{
94-
MSID_LOG_WITH_CTX_PII(MSIDLogLevelError, requestParameters, @"GetDeviceInfo: Get error when creating ssoExtensionRequest: %@", MSID_PII_LOG_MASKABLE(requestError));
95-
completionBlock(nil, requestError);
96-
return;
97-
}
89+
MSID_LOG_WITH_CTX_PII(MSIDLogLevelError, requestParameters, @"GetDeviceInfo: Get error when creating ssoExtensionRequest: %@", MSID_PII_LOG_MASKABLE(requestError));
90+
completionBlock(nil, requestError);
91+
return;
92+
}
93+
94+
if (![self setCurrentSSOExtensionRequest:ssoExtensionRequest])
95+
{
96+
MSID_LOG_WITH_CTX(MSIDLogLevelError, requestParameters, @"GetDeviceInfo: Cannot start Sso Extension as another is in progress");
97+
NSError *error = MSIDCreateError(MSIDErrorDomain, MSIDErrorInternal, @"Trying to start a get accounts request while one is already executing", nil, nil, nil, nil, nil, YES);
98+
completionBlock(nil, error);
99+
return;
100+
}
98101

99-
if (![self setCurrentSSOExtensionRequest:ssoExtensionRequest])
102+
MSID_LOG_WITH_CTX_PII(MSIDLogLevelInfo, requestParameters, @"GetDeviceInfo: Invoking Sso Extension with ssoExtensionRequest: %@", MSID_PII_LOG_MASKABLE(ssoExtensionRequest));
103+
[ssoExtensionRequest executeRequestWithCompletion:^(MSIDDeviceInfo * _Nullable deviceInfo, NSError * _Nullable error)
104+
{
105+
MSID_LOG_WITH_CTX_PII(MSIDLogLevelInfo, requestParameters, @"GetDeviceInfo: Receiving results from Sso Extension with device info: %@, error: %@", MSID_PII_LOG_MASKABLE(deviceInfo), MSID_PII_LOG_MASKABLE(error));
106+
[self copyAndClearCurrentSSOExtensionRequest];
107+
108+
if (!deviceInfo)
100109
{
101-
MSID_LOG_WITH_CTX(MSIDLogLevelError, requestParameters, @"GetDeviceInfo: Cannot start Sso Extension as another is in progress");
102-
NSError *error = MSIDCreateError(MSIDErrorDomain, MSIDErrorInternal, @"Trying to start a get accounts request while one is already executing", nil, nil, nil, nil, nil, YES);
103-
completionBlock(nil, error);
110+
// We are returing registration details irrespective of failures due to SSO extension request as registration details must have for few clients
111+
// Once we identify and fix the intermittent SSO extension issue then we should return either deviceInfo or error
112+
MSID_LOG_WITH_CTX_PII(MSIDLogLevelError, nil, @"GetDeviceInfo: Error getting device info: %@", MSID_PII_LOG_MASKABLE(error));
113+
fillDeviceInfoCompletionBlock(nil, error);
104114
return;
105115
}
106116

107-
MSID_LOG_WITH_CTX_PII(MSIDLogLevelInfo, requestParameters, @"GetDeviceInfo: Invoking Sso Extension with ssoExtensionRequest: %@", MSID_PII_LOG_MASKABLE(ssoExtensionRequest));
108-
[ssoExtensionRequest executeRequestWithCompletion:^(MSIDDeviceInfo * _Nullable deviceInfo, NSError * _Nullable error)
109-
{
110-
MSID_LOG_WITH_CTX_PII(MSIDLogLevelInfo, requestParameters, @"GetDeviceInfo: Receiving results from Sso Extension with device info: %@, error: %@", MSID_PII_LOG_MASKABLE(deviceInfo), MSID_PII_LOG_MASKABLE(error));
111-
[self copyAndClearCurrentSSOExtensionRequest];
112-
113-
if (!deviceInfo)
114-
{
115-
// We are returing registration details irrespective of failures due to SSO extension request as registration details must have for few clients
116-
// Once we identify and fix the intermittent SSO extension issue then we should return either deviceInfo or error
117-
MSID_LOG_WITH_CTX_PII(MSIDLogLevelError, nil, @"GetDeviceInfo: Error getting device info: %@", MSID_PII_LOG_MASKABLE(error));
118-
fillDeviceInfoCompletionBlock(nil, error);
119-
return;
120-
}
121-
122-
MSALDeviceInformation *msalDeviceInfo = [[MSALDeviceInformation alloc] initWithMSIDDeviceInfo:deviceInfo];
123-
fillDeviceInfoCompletionBlock(msalDeviceInfo, nil);
124-
return;
125-
}];
126-
}
117+
MSALDeviceInformation *msalDeviceInfo = [[MSALDeviceInformation alloc] initWithMSIDDeviceInfo:deviceInfo];
118+
fillDeviceInfoCompletionBlock(msalDeviceInfo, nil);
119+
return;
120+
}];
127121
}
128122

129123
- (void)wpjMetaDataDeviceInfoWithRequestParameters:(MSIDRequestParameters *)requestParameters

MSAL/src/instance/MSALSSOExtensionRequestHandler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ NS_ASSUME_NONNULL_BEGIN
3131

3232
@interface MSALSSOExtensionRequestHandler : NSObject
3333

34-
- (BOOL)setCurrentSSOExtensionRequest:(id)request API_AVAILABLE(ios(13.0), macos(10.15));
35-
- (id)copyAndClearCurrentSSOExtensionRequest API_AVAILABLE(ios(13.0), macos(10.15));
34+
- (BOOL)setCurrentSSOExtensionRequest:(id)request;
35+
- (id)copyAndClearCurrentSSOExtensionRequest;
3636

3737
@end
3838

0 commit comments

Comments
 (0)