Skip to content

Commit

Permalink
Release/1.2.0 (#1444)
Browse files Browse the repository at this point in the history
* Allow to pass eqp to the /token endpoint.

* Update changelog.

* ..

* updated changelog

* Update common core

* Updating common-core for fix in embedded wv

* Updating changelog

* Add PR number in changelog

* Add additional flag to know when to wipe cache for all accounts.

* Add button to wipe all accounts in MSAL Test App

* Update submodule

* Update submodule

* Update submodule

* Merge master in dev (#1432)

* Updating MSAL framework checksum & url for 1.1.25 [skip ci]

* Merge release 1.1.26 in master (#1429)

* Allow to pass eqp to the /token endpoint.

* Update changelog.

* ..

* updated changelog

* Update common core

* Updating common-core for fix in embedded wv

* Updating changelog

* Add PR number in changelog

* Update changelog.

Co-authored-by: petlee <petlee@microsoft.com>
Co-authored-by: Peter Lee <30302999+NerevarineRule@users.noreply.github.com>
Co-authored-by: Jason Zeng <zeyong@microsoft.com>
Co-authored-by: Ameya Patil <amepatil@microsoft.com>

* Updating MSAL framework checksum & url for 1.1.26 [skip ci]

Co-authored-by: Yong Zeng <zeyong@microsoft.com>
Co-authored-by: petlee <petlee@microsoft.com>
Co-authored-by: Peter Lee <30302999+NerevarineRule@users.noreply.github.com>
Co-authored-by: Ameya Patil <amepatil@microsoft.com>

* Multiple WPJ PkeyAuth support

* Add a list of additional locations for partner caches to be wiped. Add unit test.

* Update changelog

* Update comments for wipeCacheForAllAccounts property.

* Add SBOM task (#1425)

* Add SBOM task.

* Update sbom task.

* Changes to expose Mdm Id via Device Info sso ext request

* Addressed review comments

* Multitenant PkeyAuth support

* Merge dev in common core

* Updated changelog

* Fixed changelog

* Fixed library version in Info.plist files

* Revert breaking API change to unbreak MSAL CPP

* Update code to remove token cache from additional locations, allow to continue in case one fails but keep track of the list of failed locations.

* Fix build error, code will only run on MacOS

* Updated to return mdmId only if not nil or not empty

* Add more logs in getDeviceInfo flow due to an IcM (#1439)

* Add more logs in getDeviceInfo flow due to an IcM

* Address Cr

* Read the keychain data in order to trigger the prompt asking for login password, user HAS TO click 'Always Allow' to then be able to delete it.

* Update submodule

* Return failing additional partner locations as userInfo in case of error.
Add test that check wiping for additional partner locations.

* Continue trying to remove remaining partner locations cache if there is a read error.

* Update MSAL.podspec

The project does not seem to be a preliminary preview any longer.

* Update common core to v2 pkeyauth changes

* Addressed additional comments

* Addressed comments

* Added more test cases

* common core updated

* updated msal to point to latest common core after common core merge

* update versions

* Kaisong1990/resolve merge release conflicts (#1442)

* Updating MSAL framework checksum & url for 1.1.25 [skip ci]

* Merge release 1.1.26 in master (#1429)

* Allow to pass eqp to the /token endpoint.

* Update changelog.

* ..

* updated changelog

* Update common core

* Updating common-core for fix in embedded wv

* Updating changelog

* Add PR number in changelog

* Update changelog.

Co-authored-by: petlee <petlee@microsoft.com>
Co-authored-by: Peter Lee <30302999+NerevarineRule@users.noreply.github.com>
Co-authored-by: Jason Zeng <zeyong@microsoft.com>
Co-authored-by: Ameya Patil <amepatil@microsoft.com>

* Updating MSAL framework checksum & url for 1.1.26 [skip ci]

* point to release 1.7.5

* add a space to trigger pipeline

Co-authored-by: Yong Zeng <zeyong@microsoft.com>
Co-authored-by: Sergei Demchenko <sedemche@microsoft.com>
Co-authored-by: petlee <petlee@microsoft.com>
Co-authored-by: Peter Lee <30302999+NerevarineRule@users.noreply.github.com>
Co-authored-by: Ameya Patil <amepatil@microsoft.com>

* Kaisong1990/update automation device version (#1445)

* Update the simulator target

* fix for Umbrella header for module 'MSAL' does not include header 'MSALWipeCacheForAllAccountsConfig.h' in automation

* Add fix to disable to disable 3 tests due to Labe pending certificate, also apply fix on one test

* Update CommonCore submodule to align with its latest master hash (#1450)

Co-authored-by: Sergey Demchenko <sedemche@microsoft.com>
Co-authored-by: petlee <petlee@microsoft.com>
Co-authored-by: Peter Lee <30302999+NerevarineRule@users.noreply.github.com>
Co-authored-by: Jason Zeng <zeyong@microsoft.com>
Co-authored-by: Ameya Patil <amepatil@microsoft.com>
Co-authored-by: Juan Arias Roldan <jariasroldan@microsoft.com>
Co-authored-by: Olga Dalton <olgadalton@olgas-work-mac.lan>
Co-authored-by: Veena Soman <veenasoman@microsoft.com>
Co-authored-by: Olga Dalton <olgadalton@Olgas-Work-Mac.local>
Co-authored-by: Wolfgang Lutz <WLBORg@gmx.de>
Co-authored-by: Olga Dalton <oldalton@microsoft.com>
Co-authored-by: Juan Arias <juan-arias@users.noreply.github.com>
  • Loading branch information
13 people committed Mar 2, 2022
1 parent de9e253 commit e7db00e
Show file tree
Hide file tree
Showing 26 changed files with 571 additions and 35 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
## [1.2.0]
* Multi-tenant PkeyAuth support in MSAL (#1438)
* Add support to wipe cache for all accounts (#1426)

## [1.1.26]
* Added more string utils in common core (#1417)
* Fixed links in iframe to open in themselves instead of browser for embedded web views (#1424)
Expand Down
6 changes: 3 additions & 3 deletions MSAL.podspec
@@ -1,9 +1,9 @@
Pod::Spec.new do |s|
s.name = "MSAL"
s.version = "1.1.26"
s.summary = "Microsoft Authentication Library (MSAL) Preview for iOS"
s.version = "1.2.0"
s.summary = "Microsoft Authentication Library (MSAL) for iOS"
s.description = <<-DESC
The MSAL library preview for iOS gives your app the ability to begin using the Microsoft Cloud by supporting Microsoft Azure Active Directory and Microsoft Accounts in a converged experience using industry standard OAuth2 and OpenID Connect. The library also supports Microsoft Azure B2C for those using our hosted identity management service.
The MSAL library for iOS gives your app the ability to begin using the Microsoft Cloud by supporting Microsoft Azure Active Directory and Microsoft Accounts in a converged experience using industry standard OAuth2 and OpenID Connect. The library also supports Microsoft Azure B2C for those using our hosted identity management service.
DESC
s.homepage = "https://github.com/AzureAD/microsoft-authentication-library-for-objc"
s.license = {
Expand Down
2 changes: 1 addition & 1 deletion MSAL/IdentityCore
Submodule IdentityCore updated 38 files
+10 −0 IdentityCore/IdentityCore.xcodeproj/project.pbxproj
+1 −0 IdentityCore/MSIDTestsHostApp/MSIDTestsHostApp.entitlements
+1 −0 IdentityCore/src/MSIDBrokerConstants.h
+1 −0 IdentityCore/src/MSIDBrokerConstants.m
+1 −0 IdentityCore/src/broker_operation/request/account_request/MSIDBrokerOperationSignoutFromDeviceRequest.h
+3 −0 IdentityCore/src/broker_operation/request/account_request/MSIDBrokerOperationSignoutFromDeviceRequest.m
+2 −0 IdentityCore/src/broker_operation/response/MSIDDeviceInfo.h
+2 −1 IdentityCore/src/broker_operation/response/MSIDDeviceInfo.m
+3 −0 IdentityCore/src/cache/accessor/MSIDDefaultTokenCacheAccessor.h
+37 −0 IdentityCore/src/cache/accessor/MSIDDefaultTokenCacheAccessor.m
+20 −13 IdentityCore/src/cache/crypto/MSIDAssymetricKeyKeychainGenerator.m
+51 −0 IdentityCore/src/cache/crypto/MSIDWPJKeyPairWithCert.h
+115 −0 IdentityCore/src/cache/crypto/MSIDWPJKeyPairWithCert.m
+1 −0 IdentityCore/src/controllers/MSIDRequestControllerFactory.h
+2 −0 IdentityCore/src/controllers/MSIDRequestControllerFactory.m
+2 −0 IdentityCore/src/controllers/broker/MSIDSSOExtensionSignoutController.h
+3 −0 IdentityCore/src/controllers/broker/MSIDSSOExtensionSignoutController.m
+1 −1 IdentityCore/src/requests/broker/MSIDSSOExtensionGetAccountsRequest.m
+1 −1 IdentityCore/src/requests/broker/MSIDSSOExtensionGetDeviceInfoRequest.m
+1 −0 IdentityCore/src/requests/broker/MSIDSSOExtensionSignoutRequest.h
+4 −0 IdentityCore/src/requests/broker/MSIDSSOExtensionSignoutRequest.m
+6 −5 IdentityCore/src/util/NSDictionary+MSIDExtensions.m
+4 −2 IdentityCore/src/workplacejoin/MSIDPkeyAuthHelper.m
+4 −8 IdentityCore/src/workplacejoin/MSIDRegistrationInformation.h
+3 −6 IdentityCore/src/workplacejoin/MSIDRegistrationInformation.m
+5 −2 IdentityCore/src/workplacejoin/MSIDWorkPlaceJoinUtil.h
+16 −0 IdentityCore/src/workplacejoin/MSIDWorkPlaceJoinUtilBase.h
+79 −2 IdentityCore/src/workplacejoin/MSIDWorkPlaceJoinUtilBase.m
+65 −11 IdentityCore/src/workplacejoin/ios/MSIDWorkPlaceJoinUtil.m
+8 −109 IdentityCore/src/workplacejoin/mac/MSIDWorkPlaceJoinUtil.m
+3 −1 IdentityCore/tests/MSIDBrokerOperationSignoutFromDeviceRequestTests.m
+4 −1 IdentityCore/tests/MSIDDeviceInfoTests.m
+11 −5 IdentityCore/tests/MSIDDictionaryExtensionsTests.m
+5 −5 IdentityCore/tests/MSIDPkeyAuthHelperTests.m
+231 −21 IdentityCore/tests/MSIDWorkPlaceJoinUtilTests.m
+78 −0 IdentityCore/tests/integration/MSIDDefaultTokenCacheIntegrationTests.m
+4 −0 IdentityCore/tests/integration/MSIDSSOExtensionSignoutRequestIntegrationTests.m
+7 −0 changelog.txt
1 change: 1 addition & 0 deletions MSAL/MSAL Test App.entitlements
Expand Up @@ -8,6 +8,7 @@
<string>$(AppIdentifierPrefix)com.microsoft.adalcache</string>
<string>$(AppIdentifierPrefix)com.microsoft.workplacejoin</string>
<string>$(AppIdentifierPrefix)com.microsoft.ssoseeding</string>
<string>$(AppIdentifierPrefix)com.microsoft.workplacejoin.v2</string>
</array>
</dict>
</plist>
20 changes: 20 additions & 0 deletions MSAL/MSAL.xcodeproj/project.pbxproj
Expand Up @@ -88,6 +88,14 @@
04D32CAF1FD615B3000B123E /* MSALErrorConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 04D32CAD1FD615B3000B123E /* MSALErrorConverter.m */; };
04D32CD01FD8AFF3000B123E /* MSALErrorConverterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 04D32CCF1FD8AFF3000B123E /* MSALErrorConverterTests.m */; };
04D32CD11FD8AFF3000B123E /* MSALErrorConverterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 04D32CCF1FD8AFF3000B123E /* MSALErrorConverterTests.m */; };
0D96DB3727850E3900DEAF87 /* MSALWipeCacheForAllAccountsConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D96DB3627850E3900DEAF87 /* MSALWipeCacheForAllAccountsConfig.m */; };
0D96DB3827850E8200DEAF87 /* MSALWipeCacheForAllAccountsConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D96DB3627850E3900DEAF87 /* MSALWipeCacheForAllAccountsConfig.m */; };
0D96DB3927850E8400DEAF87 /* MSALWipeCacheForAllAccountsConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D96DB3627850E3900DEAF87 /* MSALWipeCacheForAllAccountsConfig.m */; };
0D96DB3A27850E8500DEAF87 /* MSALWipeCacheForAllAccountsConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D96DB3627850E3900DEAF87 /* MSALWipeCacheForAllAccountsConfig.m */; };
0D96DB3B27850F0E00DEAF87 /* MSALWipeCacheForAllAccountsConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D96DB2E27850E1300DEAF87 /* MSALWipeCacheForAllAccountsConfig.h */; settings = {ATTRIBUTES = (Public, ); }; };
0D96DB3C27850F0F00DEAF87 /* MSALWipeCacheForAllAccountsConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D96DB2E27850E1300DEAF87 /* MSALWipeCacheForAllAccountsConfig.h */; settings = {ATTRIBUTES = (Public, ); }; };
0D96DB3D27850F1100DEAF87 /* MSALWipeCacheForAllAccountsConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D96DB2E27850E1300DEAF87 /* MSALWipeCacheForAllAccountsConfig.h */; settings = {ATTRIBUTES = (Public, ); }; };
0D96DB3E27850F1200DEAF87 /* MSALWipeCacheForAllAccountsConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D96DB2E27850E1300DEAF87 /* MSALWipeCacheForAllAccountsConfig.h */; settings = {ATTRIBUTES = (Public, ); }; };
1E04572324BD5A7D00444756 /* MSALCacheItemDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1E04572024BD5A7D00444756 /* MSALCacheItemDetailViewController.m */; };
1E06CD6524D116F800E3D0E5 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6A206371FC510B500755A51 /* Security.framework */; };
1E1A2E042256D12F001009ED /* MSALTestAppSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = D61A64B01E5AAC5C0086D120 /* MSALTestAppSettings.m */; };
Expand Down Expand Up @@ -1096,6 +1104,8 @@
04D32CAC1FD61585000B123E /* MSALErrorConverter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSALErrorConverter.h; sourceTree = "<group>"; };
04D32CAD1FD615B3000B123E /* MSALErrorConverter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSALErrorConverter.m; sourceTree = "<group>"; };
04D32CCF1FD8AFF3000B123E /* MSALErrorConverterTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSALErrorConverterTests.m; sourceTree = "<group>"; };
0D96DB2E27850E1300DEAF87 /* MSALWipeCacheForAllAccountsConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSALWipeCacheForAllAccountsConfig.h; sourceTree = "<group>"; };
0D96DB3627850E3900DEAF87 /* MSALWipeCacheForAllAccountsConfig.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSALWipeCacheForAllAccountsConfig.m; sourceTree = "<group>"; };
1E04571F24BD5A7D00444756 /* MSALCacheItemDetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSALCacheItemDetailViewController.h; sourceTree = "<group>"; };
1E04572024BD5A7D00444756 /* MSALCacheItemDetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSALCacheItemDetailViewController.m; sourceTree = "<group>"; };
1E1A2E052256D194001009ED /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -1708,6 +1718,7 @@
96B5E6F02256D197002232F9 /* MSALExtraQueryParameters.h */,
96B5E6F12256D197002232F9 /* MSALExtraQueryParameters.m */,
2338295622D7E49E001B8AD6 /* MSALWebviewParameters.m */,
0D96DB3627850E3900DEAF87 /* MSALWipeCacheForAllAccountsConfig.m */,
);
path = configuration;
sourceTree = "<group>";
Expand Down Expand Up @@ -1941,6 +1952,7 @@
96B5E6CC2256D152002232F9 /* MSALCacheConfig.h */,
B29A56A4228262770023F5E6 /* MSALExternalAccountProviding.h */,
B29A56B8228266B40023F5E6 /* MSALSerializedADALCacheProvider.h */,
0D96DB2E27850E1300DEAF87 /* MSALWipeCacheForAllAccountsConfig.h */,
);
path = cache;
sourceTree = "<group>";
Expand Down Expand Up @@ -2512,6 +2524,7 @@
B2D4789D230E3E14005AE186 /* MSALAccount+MultiTenantAccount.h in Headers */,
B2D47889230E3DCC005AE186 /* MSALAADOauth2Provider.h in Headers */,
B273D0AD226E8585005A7BB4 /* MSALErrorConverter+Internal.h in Headers */,
0D96DB3E27850F1200DEAF87 /* MSALWipeCacheForAllAccountsConfig.h in Headers */,
B2D478B8230E3E90005AE186 /* MSALExternalAccountHandler.h in Headers */,
1E5319C724A51F33007BCF30 /* MSALHttpMethod.h in Headers */,
04A6B5C0226937530035C7C2 /* MSALAccount+Internal.h in Headers */,
Expand Down Expand Up @@ -2634,6 +2647,7 @@
B273D07F226E8507005A7BB4 /* MSALPublicClientStatusNotifications.h in Headers */,
B2D478AC230E3E88005AE186 /* MSALLegacySharedMSAAccount.h in Headers */,
B2D4789E230E3E2C005AE186 /* MSALWebviewParameters.h in Headers */,
0D96DB3D27850F1100DEAF87 /* MSALWipeCacheForAllAccountsConfig.h in Headers */,
B2D478AA230E3E82005AE186 /* MSALLegacySharedADALAccount.h in Headers */,
B273D0B6226E8596005A7BB4 /* MSALPublicClientApplication+Internal.h in Headers */,
B2D47890230E3DD9005AE186 /* MSALOauth2Provider+Internal.h in Headers */,
Expand Down Expand Up @@ -2748,6 +2762,7 @@
B273D0C1226E85A7005A7BB4 /* MSALGlobalConfig+Internal.h in Headers */,
232D69002240A3FF00594BBD /* MSALTokenParameters+Internal.h in Headers */,
B273D0C7226E85C2005A7BB4 /* MSALCacheConfig+Internal.h in Headers */,
0D96DB3B27850F0E00DEAF87 /* MSALWipeCacheForAllAccountsConfig.h in Headers */,
96CF95232268FD0500D97374 /* MSALAuthority.h in Headers */,
B27CCDF2229F9F4700CAD565 /* MSALAccountEnumerationParameters.h in Headers */,
963377BF211E14C600943EE0 /* MSALWebviewType_Internal.h in Headers */,
Expand Down Expand Up @@ -2859,6 +2874,7 @@
1EDAE331218A4FA2001898E1 /* MSALAuthority_Internal.h in Headers */,
23014D4625672DF9005E12F2 /* MSALAuthenticationSchemePop+Internal.h in Headers */,
B273D0C0226E85A7005A7BB4 /* MSALGlobalConfig+Internal.h in Headers */,
0D96DB3C27850F0F00DEAF87 /* MSALWipeCacheForAllAccountsConfig.h in Headers */,
963377C0211E14C600943EE0 /* MSALWebviewType_Internal.h in Headers */,
B203459E21AFA1FB00B221AA /* MSALRedirectUri+Internal.h in Headers */,
);
Expand Down Expand Up @@ -3507,6 +3523,7 @@
1E5319C024A51E07007BCF30 /* MSALAuthenticationSchemePop.m in Sources */,
B273D0E0226E85E3005A7BB4 /* MSALExtraQueryParameters.m in Sources */,
1E5319BC24A51DF5007BCF30 /* MSALAuthenticationSchemeBearer.m in Sources */,
0D96DB3927850E8400DEAF87 /* MSALWipeCacheForAllAccountsConfig.m in Sources */,
2343CBF02576C2D3002D405A /* MSALParameters.m in Sources */,
B2D478B4230E3E8B005AE186 /* MSALSerializedADALCacheProvider.m in Sources */,
38880DF423280C5900688C24 /* MSALPublicClientApplicationConfig.m in Sources */,
Expand Down Expand Up @@ -3588,6 +3605,7 @@
B273D0A4226E8577005A7BB4 /* MSALIndividualClaimRequest.m in Sources */,
1E5319BD24A51DF6007BCF30 /* MSALAuthenticationSchemeBearer.m in Sources */,
583BFD0F24DC8E670035B901 /* MSALRedirectUriVerifier.m in Sources */,
0D96DB3A27850E8500DEAF87 /* MSALWipeCacheForAllAccountsConfig.m in Sources */,
04A6B5B2226937070035C7C2 /* MSALPromptType.m in Sources */,
B2D478BE230E3EAF005AE186 /* MSALTenantProfile.m in Sources */,
B2D478A8230E3E5A005AE186 /* MSALTelemetryEventsObservingProxy.m in Sources */,
Expand Down Expand Up @@ -3805,6 +3823,7 @@
B29A56C222826EE20023F5E6 /* MSALSerializedADALCacheProvider.m in Sources */,
B2C0E79F23AC7996006C9CAD /* MSALParameters.m in Sources */,
B21E07B3210E542C007E3A3C /* MSALRedirectUriVerifier.m in Sources */,
0D96DB3727850E3900DEAF87 /* MSALWipeCacheForAllAccountsConfig.m in Sources */,
96B5E6EE2256D180002232F9 /* MSALSliceConfig.m in Sources */,
B2A3C28B2145FD0F0082525C /* MSALAccountsProvider.m in Sources */,
1EE776C6246C98E700F7EBFC /* MSALAuthenticationSchemePop.m in Sources */,
Expand Down Expand Up @@ -3873,6 +3892,7 @@
23A68A7D20F538B90071E435 /* MSALB2CAuthority.m in Sources */,
96B5E6EF2256D180002232F9 /* MSALSliceConfig.m in Sources */,
B2A3C28C2145FD0F0082525C /* MSALAccountsProvider.m in Sources */,
0D96DB3827850E8200DEAF87 /* MSALWipeCacheForAllAccountsConfig.m in Sources */,
232D68D9223DB8C200594BBD /* MSALSilentTokenParameters.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Expand Up @@ -46,6 +46,17 @@
BlueprintName = "InteractiveiOSTests"
ReferencedContainer = "container:MSAL.xcodeproj">
</BuildableReference>
<SkippedTests>
<Test
Identifier = "MSALPingUITests/testInteractivePingLogin_withConvergedApp_withPromptAlways_withLoginHint_andPassedInWebView">
</Test>
<Test
Identifier = "MSALPingUITests/testInteractivePingLogin_withConvergedApp_withPromptAlways_withLoginHint_andSystemWebView">
</Test>
<Test
Identifier = "MSALPingUITests/testInteractivePingLogin_withNonConvergedApp_withPromptAlways_noLoginHint_andEmbeddedWebView">
</Test>
</SkippedTests>
</TestableReference>
<TestableReference
skipped = "NO">
Expand Down
2 changes: 1 addition & 1 deletion MSAL/resources/ios/Info.plist
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.26</string>
<string>1.2.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
2 changes: 1 addition & 1 deletion MSAL/resources/mac/Info.plist
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.26</string>
<string>1.2.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
5 changes: 5 additions & 0 deletions MSAL/src/MSALDeviceInformation.m
Expand Up @@ -30,6 +30,7 @@
#import "MSIDDeviceInfo.h"
#import <AuthenticationServices/AuthenticationServices.h>
#import "ASAuthorizationSingleSignOnProvider+MSIDExtensions.h"
#import "MSIDBrokerConstants.h"

NSString *const MSAL_DEVICE_INFORMATION_SSO_EXTENSION_FULL_MODE_KEY = @"isSSOExtensionInFullMode";

Expand Down Expand Up @@ -115,6 +116,10 @@ - (NSString *)msalDeviceModeString
- (void) initExtraDeviceInformation:(MSIDDeviceInfo *)deviceInfo
{
[_extraDeviceInformation setValue:deviceInfo.ssoExtensionMode == MSIDSSOExtensionModeFull ? @"Yes" : @"No" forKey:MSAL_DEVICE_INFORMATION_SSO_EXTENSION_FULL_MODE_KEY];
if (![NSString msidIsStringNilOrBlank:deviceInfo.mdmId])
{
[_extraDeviceInformation setValue:deviceInfo.mdmId forKey:MSID_BROKER_MDM_ID_KEY];
}
}

- (void) addRegisteredDeviceMetadataInformation:(NSDictionary *)deviceInfoMetadata
Expand Down
78 changes: 76 additions & 2 deletions MSAL/src/MSALPublicClientApplication.m
Expand Up @@ -109,6 +109,7 @@
#import "MSIDDevicePopManager.h"
#import "MSIDAssymetricKeyLookupAttributes.h"
#import "MSIDRequestTelemetryConstants.h"
#import "MSALWipeCacheForAllAccountsConfig.h"

@interface MSALPublicClientApplication()
{
Expand Down Expand Up @@ -1434,12 +1435,84 @@ - (void)signoutWithAccount:(nonnull MSALAccount *)account
block(NO, localError, nil);
return;
}

if (signoutParameters.wipeCacheForAllAccounts)
{
BOOL result = YES;
NSError *localError;

result = [self.tokenCache clearCacheForAllAccountsWithContext:nil error:&localError];

if (!result)
{
block(NO, localError, nil);
return;
}


#if !TARGET_OS_IPHONE
// Clear additional cache locations
NSDictionary<NSString *, NSDictionary *> *additionalPartnerLocations = MSALWipeCacheForAllAccountsConfig.additionalPartnerLocations;
if (additionalPartnerLocations && additionalPartnerLocations.count > 0)
{
NSError *removePartnerLocationError = nil;
NSMutableArray <NSString *> *locationErrors = nil;
MSIDMacACLKeychainAccessor *keychainAccessor = [[MSIDMacACLKeychainAccessor alloc] initWithTrustedApplications:nil accessLabel:@"Microsoft Credentials" error:nil];
for (NSString* locationName in additionalPartnerLocations)
{
localError = nil;
NSDictionary *cacheLocation = additionalPartnerLocations[locationName];

// Try to read the keychain data in order to trigger the prompt asking for login password, user HAS TO click 'Always Allow' to then be able to delete it.
[keychainAccessor getDataWithAttributes:cacheLocation
context:nil
error:&localError];

if (localError)
{
result = NO;
if (!locationErrors)
{
locationErrors = [[NSMutableArray alloc] init];
}
[locationErrors addObject:[NSString stringWithFormat:@"'%@'", locationName]];
NSError *additionalLocationError = MSIDCreateError(MSIDErrorDomain, MSIDErrorInternal, [NSString stringWithFormat:@"WipeCacheForAllAccounts - error when reading cache for the item: %@.", locationName], nil, nil, localError, nil, nil, YES);
removePartnerLocationError = additionalLocationError;
continue;
}

BOOL removeResult = [keychainAccessor removeItemWithAttributes:cacheLocation
context:nil
error:&localError];

if (!removeResult)
{
result = NO;
if (!locationErrors)
{
locationErrors = [[NSMutableArray alloc] init];
}
[locationErrors addObject:[NSString stringWithFormat:@"'%@'", locationName]];
removePartnerLocationError = localError;
}
}

if (!result && locationErrors)
{
NSError *additionalLocationError = MSIDCreateError(MSIDErrorDomain, MSIDErrorInternal, [NSString stringWithFormat:@"WipeCacheForAllAccounts - error when removing cache for the item(s): %@. User might need to select 'Always Allow' when prompted the login password to access keychain.", [locationErrors componentsJoinedByString:@", "]], nil, nil, removePartnerLocationError, nil, @{@"locationErrors":locationErrors}, YES);
block(NO, additionalLocationError, nil);
return;
}
}
#endif
}

NSError *controllerError;
MSIDSignoutController *controller = [MSIDRequestControllerFactory signoutControllerForParameters:msidParams
oauthFactory:self.msalOauth2Provider.msidOauth2Factory
shouldSignoutFromBrowser:signoutParameters.signoutFromBrowser
shouldWipeAccount:signoutParameters.wipeAccount
shouldWipeCacheForAllAccounts:signoutParameters.wipeCacheForAllAccounts
error:&controllerError];

if (!controller)
Expand All @@ -1459,7 +1532,7 @@ - (void)signoutWithAccount:(nonnull MSALAccount *)account
- (void)getDeviceInformationWithParameters:(MSALParameters *)parameters
completionBlock:(MSALDeviceInformationCompletionBlock)completionBlock
{
MSID_LOG_WITH_CTX_PII(MSIDLogLevelInfo, nil, @"Querying device info");
MSID_LOG_WITH_CTX(MSIDLogLevelInfo, nil, @"Querying device info");

__auto_type block = ^(MSALDeviceInformation * _Nullable deviceInformation, NSError * _Nullable msidError)
{
Expand All @@ -1471,7 +1544,7 @@ - (void)getDeviceInformationWithParameters:(MSALParameters *)parameters
}
else
{
MSID_LOG_WITH_CTX_PII(MSIDLogLevelInfo, nil, @"Retrieved device info %@", deviceInformation);
MSID_LOG_WITH_CTX_PII(MSIDLogLevelInfo, nil, @"Retrieved device info %@", MSID_PII_LOG_MASKABLE(deviceInformation));
}

[MSALPublicClientApplication logOperation:@"getDeviceInformation" result:nil error:msalError context:nil];
Expand All @@ -1495,6 +1568,7 @@ - (void)getDeviceInformationWithParameters:(MSALParameters *)parameters

if (!requestParams)
{
MSID_LOG_WITH_CTX_PII(MSIDLogLevelError, nil, @"GetDeviceInfo: Error when creating requestParams: %@", requestParamsError);
block(nil, requestParamsError);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions MSAL/src/MSAL_Internal.h
Expand Up @@ -26,8 +26,8 @@
//------------------------------------------------------------------------------

#define MSAL_VER_HIGH 1
#define MSAL_VER_LOW 1
#define MSAL_VER_PATCH 26
#define MSAL_VER_LOW 2
#define MSAL_VER_PATCH 0

#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
Expand Down

0 comments on commit e7db00e

Please sign in to comment.