Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
29e048c
Updated macOS minimum version to 10.15
spetrescu84 Jun 25, 2024
a9b9e7c
adding new federation provider type ciam cud
fidelianawar Jun 25, 2024
c7a91d6
Removed @available checks and #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1…
spetrescu84 Jun 26, 2024
8cc6d45
Updated changelog.txt
spetrescu84 Jun 26, 2024
111dba7
Merge branch 'dev' of https://github.com/AzureAD/microsoft-authentica…
fidelianawar Jun 26, 2024
5302e5e
Changed the import to allow NativeAuth tests to properly use MSIDTest…
spetrescu84 Jul 1, 2024
2b9837a
PR comments
spetrescu84 Jul 1, 2024
436e18d
Changed the #if with __MAC_OS_X_VERSION_MAX_ALLOWED in them
spetrescu84 Jul 2, 2024
4670fef
Changed the MAC Catalyst check
spetrescu84 Jul 2, 2024
3dbdcc3
Removed older checks of iOS/macOS version.
spetrescu84 Jul 2, 2024
5b53813
Merge branch 'dev' into spetrescu/increase-mac-version
spetrescu84 Jul 2, 2024
5fa0f7a
Merge branch 'spetrescu/increase-mac-version' into spetrescu/macos-su…
spetrescu84 Jul 3, 2024
f3d8bb1
Merge branch 'dev' into spetrescu/increase-mac-version
spetrescu84 Jul 12, 2024
4a0b9b1
Merge branch 'spetrescu/increase-mac-version' into spetrescu/macos-su…
spetrescu84 Jul 12, 2024
1236a66
Updates for macOS 10.15
spetrescu84 Jul 12, 2024
31dbcfe
Merge branch 'dev' into spetrescu/increase-mac-version
spetrescu84 Jul 29, 2024
b0d59ed
Merge branch 'spetrescu/increase-mac-version' into spetrescu/macos-su…
spetrescu84 Jul 29, 2024
2445ac4
Fixed merge
spetrescu84 Jul 29, 2024
387b810
Merge branch 'spetrescu/increase-mac-version' into spetrescu/macos-su…
spetrescu84 Jul 29, 2024
3ca1fcd
Set version for change to TBD
spetrescu84 Aug 1, 2024
86ffff0
Merge branch 'dev' into spetrescu/increase-mac-version
spetrescu84 Aug 1, 2024
23aae0b
Merge branch 'spetrescu/increase-mac-version' into spetrescu/macos-su…
spetrescu84 Aug 1, 2024
198c4d8
Fixed file for IdentityAutomationLibMac target
spetrescu84 Aug 1, 2024
8d16a69
Merge branch 'spetrescu/increase-mac-version' into spetrescu/macos-su…
spetrescu84 Aug 1, 2024
0011959
PR comments
spetrescu84 Aug 2, 2024
1252702
Merge branch 'spetrescu/increase-mac-version' into spetrescu/macos-su…
spetrescu84 Aug 2, 2024
6a8cae4
Merge pull request #1408 from AzureAD/swagup/merge_release_1.7.38_int…
swasti29 Aug 6, 2024
031063b
Merge branch 'dev' into spetrescu/increase-mac-version
spetrescu84 Aug 7, 2024
7181894
Merge branch 'spetrescu/increase-mac-version' into spetrescu/macos-su…
spetrescu84 Aug 7, 2024
1350f0c
Merge pull request #1388 from AzureAD/spetrescu/increase-mac-version
spetrescu84 Aug 7, 2024
72331c7
Merge branch 'dev' into spetrescu/macos-support-nativeauth
spetrescu84 Aug 7, 2024
3a51ad5
Merge pull request #1392 from AzureAD/spetrescu/macos-support-nativeauth
spetrescu84 Aug 8, 2024
f302030
merge dev
Veena11 Aug 9, 2024
14b8b28
Merge pull request #1411 from AzureAD/veena/mergeMain
Veena11 Aug 15, 2024
338a162
Merge pull request #1389 from AzureAD/fidelianawar/update_ciam_cud
fidelianawar Aug 20, 2024
b8d4248
Changed changelog to reflect version for 10.15 macOS version increase
spetrescu84 Sep 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions IdentityCore/IdentityCore.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8197,7 +8197,7 @@
INFOPLIST_FILE = MSIDTestsHostApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.microsoft.MSIDTestsHostApp;
Expand Down Expand Up @@ -8247,7 +8247,7 @@
INFOPLIST_FILE = MSIDTestsHostApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.microsoft.MSIDTestsHostApp;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -8441,7 +8441,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACH_O_TYPE = staticlib;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -8502,7 +8502,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACH_O_TYPE = staticlib;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
Expand Down Expand Up @@ -8694,7 +8694,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -8753,7 +8753,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -8811,7 +8811,7 @@
"$(inherited)",
"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks/Swift",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.15;
};
name = Debug;
};
Expand All @@ -8823,7 +8823,7 @@
"$(inherited)",
"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks/Swift",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.15;
};
name = Release;
};
Expand All @@ -8837,7 +8837,7 @@
DEVELOPMENT_TEAM = UBF8T346G9;
GCC_OPTIMIZATION_LEVEL = 0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.15;
SWIFT_OBJC_BRIDGING_HEADER = "tests/IdentityCoreTests Mac-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand All @@ -8853,7 +8853,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = UBF8T346G9;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.15;
SWIFT_OBJC_BRIDGING_HEADER = "tests/IdentityCoreTests Mac-Bridging-Header.h";
SWIFT_VERSION = 5.0;
};
Expand Down Expand Up @@ -8883,15 +8883,15 @@
baseConfigurationReference = D6CF4E991FC3626A00CD70C5 /* identitycore__testlib__mac.xcconfig */;
buildSettings = {
GCC_OPTIMIZATION_LEVEL = 0;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.15;
};
name = Debug;
};
D626FFE81FBD1F5700EE4487 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = D6CF4E991FC3626A00CD70C5 /* identitycore__testlib__mac.xcconfig */;
buildSettings = {
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.15;
};
name = Release;
};
Expand All @@ -8909,7 +8909,7 @@
);
GCC_WARN_SHADOW = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.15;
};
name = Debug;
};
Expand All @@ -8925,7 +8925,7 @@
);
GCC_WARN_SHADOW = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MACOSX_DEPLOYMENT_TARGET = 10.13;
MACOSX_DEPLOYMENT_TARGET = 10.15;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion IdentityCore/src/IdentityCore_Internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@
- (void)SETTER:(NSString *)value { [DICT setValue:[value copy] forKey:KEY]; }

#define STRING_CASE(_CASE) case _CASE: return @#_CASE
#define MSID_ENABLE_SSO_EXTENSION ((__IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 || __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500) && !MSID_EXCLUDE_WEBKIT)
#define MSID_ENABLE_SSO_EXTENSION (!MSID_EXCLUDE_WEBKIT)
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ @implementation MSIDBrokerOperationInteractiveTokenRequest

+ (void)load
{
if (@available(macOS 10.15, *))
{
[MSIDJsonSerializableFactory registerClass:self forClassType:self.operation];
}
[MSIDJsonSerializableFactory registerClass:self forClassType:self.operation];
}

+ (instancetype)tokenRequestWithParameters:(MSIDInteractiveTokenRequestParameters *)parameters
Expand Down Expand Up @@ -66,12 +63,7 @@ + (instancetype)tokenRequestWithParameters:(MSIDInteractiveTokenRequestParameter

+ (NSString *)operation
{
if (@available(macOS 10.15, *))
{
return ASAuthorizationOperationLogin;
}

return @"login";
return ASAuthorizationOperationLogin;
}

#pragma mark - MSIDJsonSerializable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ @implementation MSIDBrokerOperationSilentTokenRequest

+ (void)load
{
if (@available(macOS 10.15, *))
{
[MSIDJsonSerializableFactory registerClass:self forClassType:self.operation];
}
[MSIDJsonSerializableFactory registerClass:self forClassType:self.operation];
}

+ (instancetype)tokenRequestWithParameters:(MSIDRequestParameters *)parameters
Expand All @@ -64,12 +61,7 @@ + (instancetype)tokenRequestWithParameters:(MSIDRequestParameters *)parameters

+ (NSString *)operation
{
if (@available(macOS 10.15, *))
{
return ASAuthorizationOperationRefresh;
}

return @"refresh";
return ASAuthorizationOperationRefresh;
}

#pragma mark - MSIDJsonSerializable
Expand Down
13 changes: 2 additions & 11 deletions IdentityCore/src/cache/MSIDKeychainTokenCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,7 @@ - (nullable instancetype)initWithGroup:(nullable NSString *)keychainGroup error:
(id)kSecAttrAccessGroup : self.keychainGroup} mutableCopy];

#ifdef __MAC_OS_X_VERSION_MAX_ALLOWED
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
if (@available(macOS 10.15, *)) {
defaultKeychainQuery[(id)kSecUseDataProtectionKeychain] = @YES;
}
#endif
defaultKeychainQuery[(id)kSecUseDataProtectionKeychain] = @YES;
#endif

self.defaultKeychainQuery = defaultKeychainQuery;
Expand All @@ -165,13 +161,8 @@ - (nullable instancetype)initWithGroup:(nullable NSString *)keychainGroup error:
(id)kSecAttrGeneric : [s_wipeLibraryString dataUsingEncoding:NSUTF8StringEncoding],
(id)kSecAttrAccessGroup : self.keychainGroup,
(id)kSecAttrAccount : @"TokenWipe"} mutableCopy];

#ifdef __MAC_OS_X_VERSION_MAX_ALLOWED
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
if (@available(macOS 10.15, *)) {
defaultWipeQuery[(id)kSecUseDataProtectionKeychain] = @YES;
}
#endif
defaultWipeQuery[(id)kSecUseDataProtectionKeychain] = @YES;
#endif

self.defaultWipeQuery = defaultWipeQuery;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,7 @@ @implementation MSIDAssymetricKeyGeneratorFactory
#if !TARGET_OS_IPHONE
+ (id<MSIDAssymetricKeyGenerating>)macDefaultKeyGeneratorWithCacheConfig:(MSIDCacheConfig *)cacheConfig error:(NSError *__autoreleasing*)error
{
if (@available(macOS 10.15, *))
{
return [[MSIDAssymetricKeyKeychainGenerator alloc] initWithGroup:cacheConfig.keychainGroup error:error];
}
else
{
return [[MSIDAssymetricKeyLoginKeychainGenerator alloc] initWithKeychainGroup:cacheConfig.keychainGroup accessRef:cacheConfig.accessRef error:error];
}
return [[MSIDAssymetricKeyKeychainGenerator alloc] initWithGroup:cacheConfig.keychainGroup error:error];
}
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,8 @@ - (MSIDAssymetricKeyPair *)generateKeyPairForKeyDict:(NSDictionary *)attributes
- (NSDictionary *)additionalPlatformKeychainAttributes
{
#ifdef __MAC_OS_X_VERSION_MAX_ALLOWED
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
if (@available(macOS 10.15, *)) {
return @{(id)kSecUseDataProtectionKeychain : @YES};
}
#endif
return @{(id)kSecUseDataProtectionKeychain : @YES};
#endif

return nil;
}

Expand Down
5 changes: 0 additions & 5 deletions IdentityCore/src/cache/crypto/MSIDAssymetricKeyPair.m
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,8 @@ - (NSDate *)creationDate
privateKeyQuery[(id)kSecAttrLabel] = [self.privateKeyDict objectForKey:(id)kSecAttrLabel];
privateKeyQuery[(id)kSecReturnRef] = @YES;
privateKeyQuery[(id)kSecReturnAttributes] = @YES;

#ifdef __MAC_OS_X_VERSION_MAX_ALLOWED
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
if (@available(macOS 10.15, *)) {
privateKeyQuery[(id)kSecUseDataProtectionKeychain] = @YES;
}
#endif
#endif

CFDictionaryRef result = nil;
Expand Down
53 changes: 17 additions & 36 deletions IdentityCore/src/cache/mac/MSIDMacKeychainTokenCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -367,25 +367,17 @@ + (MSIDMacKeychainTokenCache *)defaultKeychainCache

- (BOOL)shouldUseLoginKeychain
{
if (@available(macOS 10.15, *))
if ([[NSUserDefaults standardUserDefaults] boolForKey:kLoginKeychainEmptyKey])
{

if ([[NSUserDefaults standardUserDefaults] boolForKey:kLoginKeychainEmptyKey])
{
#if MS_INTERNAL_BUILD
return ![MSIDKeychainUtil sharedInstance].isAppEntitled;
return ![MSIDKeychainUtil sharedInstance].isAppEntitled;
#else
return NO;
return NO;
#endif
}
else
{
// if kLoginKeychainEmptyKey is not set
return YES;
}
}
else
{
// if kLoginKeychainEmptyKey is not set
return YES;
}
}
Expand All @@ -411,18 +403,15 @@ - (nullable instancetype)initWithGroup:(nullable NSString *)keychainGroup
self = [super initWithTrustedApplications:trustedApplications accessLabel:s_defaultKeychainLabel error:error];
if (self)
{
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
if (![self shouldUseLoginKeychain]) {
if (error)
{
*error = MSIDCreateError(MSIDErrorDomain, MSIDErrorInternal, @"Not creating login keychain for performance optimization on macOS 10.15, because no items where previously found in it", nil, nil, nil, nil, nil, NO);
}

MSID_LOG_WITH_CTX(MSIDLogLevelWarning, nil, @"Not creating login keychain for performance optimization on macOS 10.15, because no items where previously found in it");
return nil;
if (error)
{
*error = MSIDCreateError(MSIDErrorDomain, MSIDErrorInternal, @"Not creating login keychain for performance optimization on macOS 10.15, because no items where previously found in it", nil, nil, nil, nil, nil, NO);
}

#endif

MSID_LOG_WITH_CTX(MSIDLogLevelWarning, nil, @"Not creating login keychain for performance optimization on macOS 10.15, because no items where previously found in it");
return nil;
}

self.appStorageItem = [MSIDMacCredentialStorageItem new];
self.sharedStorageItem = [MSIDMacCredentialStorageItem new];
Expand Down Expand Up @@ -825,14 +814,12 @@ - (MSIDMacCredentialStorageItem *)queryStorageItem:(BOOL)isShared
error:(NSError *__autoreleasing*)error
{
MSID_TRACE;

#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500

if (![self shouldUseLoginKeychain])
{
MSID_LOG_WITH_CTX(MSIDLogLevelWarning, context, @"Skipping login keychain read because it has been previously marked as empty on 10.15");
return nil;
}
#endif

MSIDMacCredentialStorageItem *storageItem = nil;
NSMutableDictionary *query = [self.defaultCacheQuery mutableCopy];
Expand Down Expand Up @@ -869,18 +856,12 @@ - (MSIDMacCredentialStorageItem *)queryStorageItem:(BOOL)isShared
{
storageItemIsEmpty = YES;
}

#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
if (@available(macOS 10.15, *)) {

// Performance optimization on 10.15. If we've read shared item once and we didn't find it, or it was empty, save a flag into user defaults such as we stop looking into the login keychain altogether
if (isShared && storageItemIsEmpty)
{
MSID_LOG_WITH_CTX(MSIDLogLevelWarning, context, @"Saving a flag to stop looking into login keychain, as it doesn't contain any items");
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kLoginKeychainEmptyKey];
}

if (isShared && storageItemIsEmpty)
{
MSID_LOG_WITH_CTX(MSIDLogLevelWarning, context, @"Saving a flag to stop looking into login keychain, as it doesn't contain any items");
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kLoginKeychainEmptyKey];
}
#endif

return storageItem;
}
Expand Down
Loading
Loading