Skip to content

Commit

Permalink
Merge pull request #2338 from AzureAD/release/1.5.1
Browse files Browse the repository at this point in the history
Merge Release 1.5.1 to Main
  • Loading branch information
jasoncoolmax authored Sep 25, 2024
2 parents b873323 + 074f54c commit 08dde01
Show file tree
Hide file tree
Showing 38 changed files with 1,337 additions and 44 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [1.5.1]:
* Parse and add STS error codes in token error result (#2319)
* VisionOS support added (#2139)

## [1.5.0]
* Increased macOS minimum version to 10.15 (#2220)
* Added Native Auth feature for MacOS to interact with the Microsoft Entra ID services (#2220)
Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ CHANGELOG.md @AzureAD/AppleIdentityTeam @AzureAD/MSAL-ObjC-CIAM
/MSAL/MSAL.xcodeproj/xcshareddata/xcschemes/MSAL\ iOS\ Native\ Auth\ E2E\ Tests.xcscheme @AzureAD/MSAL-ObjC-CIAM
/MSAL/MSAL.xcodeproj/xcshareddata/xcschemes/MSAL\ Mac\ Native\ Auth\ E2E\ Tests.xcscheme @AzureAD/MSAL-ObjC-CIAM
/Package.swift @AzureAD/MSAL-ObjC-CIAM
/spm-integration-test.sh @AzureAD/MSAL-ObjC-CIAM
# For more details about inheritance patterns, or to assign different
# owners for individual file extensions, see:
# https://help.github.com/articles/about-codeowners/
2 changes: 1 addition & 1 deletion MSAL.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MSAL"
s.version = "1.5.0"
s.version = "1.5.1"
s.summary = "Microsoft Authentication Library (MSAL) for iOS"
s.description = <<-DESC
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.
Expand Down
2 changes: 1 addition & 1 deletion MSAL/IdentityCore
Submodule IdentityCore updated 41 files
+40 −2 IdentityCore/IdentityCore.xcodeproj/project.pbxproj
+1 −0 IdentityCore/src/MSIDError.h
+1 −0 IdentityCore/src/MSIDError.m
+1 −0 IdentityCore/src/MSIDOAuth2Constants.h
+1 −0 IdentityCore/src/MSIDOAuth2Constants.m
+35 −0 ...ker_operation/request/browser_native_message_request/MSIDBrowserNativeMessageGetSupportedContractsRequest.h
+53 −0 ...ker_operation/request/browser_native_message_request/MSIDBrowserNativeMessageGetSupportedContractsRequest.m
+3 −0 ...yCore/src/broker_operation/request/browser_native_message_request/MSIDBrowserNativeMessageGetTokenRequest.h
+5 −0 ...yCore/src/broker_operation/request/browser_native_message_request/MSIDBrowserNativeMessageGetTokenRequest.m
+36 −0 ..._operation/response/browser_native_message_response/MSIDBrowserNativeMessageGetSupportedContractsResponse.h
+48 −0 ..._operation/response/browser_native_message_response/MSIDBrowserNativeMessageGetSupportedContractsResponse.m
+1 −0 IdentityCore/src/oauth2/MSIDOauth2Factory.m
+3 −0 IdentityCore/src/oauth2/MSIDTokenResponse.h
+2 −0 IdentityCore/src/oauth2/MSIDTokenResponse.m
+7 −1 IdentityCore/src/oauth2/MSIDWebviewFactory.m
+1 −1 IdentityCore/src/telemetry/request_telemetry/MSIDLastRequestTelemetry.h
+10 −1 IdentityCore/src/telemetry/request_telemetry/MSIDLastRequestTelemetry.m
+1 −0 IdentityCore/src/util/NSDictionary+MSIDExtensions.h
+16 −0 IdentityCore/src/util/NSDictionary+MSIDExtensions.m
+4 −0 IdentityCore/src/util/ios/MSIDAppExtensionUtil.m
+13 −0 IdentityCore/src/util/ios/UIApplication+MSIDExtensions.m
+2 −0 IdentityCore/src/webview/embeddedWebview/challangeHandlers/ios/MSIDCertAuthHandler.m
+51 −1 IdentityCore/src/webview/embeddedWebview/ui/ios/MSIDWebviewUIController.m
+1 −1 IdentityCore/src/webview/systemWebview/ios/MSIDSafariViewController.m
+5 −1 IdentityCore/src/webview/systemWebview/session/MSIDSystemWebViewControllerFactory.m
+8 −0 IdentityCore/src/webview/systemWebview/session/MSIDSystemWebviewController.m
+1 −1 IdentityCore/tests/MSIDAccountCredentialsCacheTests.m
+2 −1 IdentityCore/tests/MSIDAccountMetadataCacheAccessorTests.m
+3 −0 IdentityCore/tests/MSIDBrowserNativeMessageGetTokenRequestTests.m
+45 −0 IdentityCore/tests/MSIDDictionaryExtensionsTests.m
+17 −0 IdentityCore/tests/MSIDOauth2FactoryTests.m
+35 −1 IdentityCore/tests/MSIDTokenResponseTests.m
+1 −1 IdentityCore/tests/integration/MSIDInteractiveControllerIntegrationTests.m
+10 −7 IdentityCore/tests/integration/MSIDLegacyAccessorSSOIntegrationTests.m
+1 −1 IdentityCore/tests/integration/ios/MSIDDefaultInteractiveTokenRequestTests.m
+1 −1 IdentityCore/tests/mocks/MSIDTestWebviewInteractingViewController.m
+2 −1 IdentityCore/xcconfig/identitycore__common__ios.xcconfig
+1 −0 IdentityCore/xcconfig/identitycore__idlib__ios.xcconfig
+20 −0 azure_pipelines/pr-validation.yml
+31 −6 build.py
+7 −0 changelog.txt
324 changes: 310 additions & 14 deletions MSAL/MSAL.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion MSAL/resources/ios/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.5.0</string>
<string>1.5.1</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
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.5.0</string>
<string>1.5.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
1 change: 1 addition & 0 deletions MSAL/src/MSALError.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
NSString *MSALOAuthErrorKey = @"MSALOAuthErrorKey";
NSString *MSALOAuthSubErrorKey = @"MSALOAuthSubErrorKey";
NSString *MSALErrorDescriptionKey = @"MSALErrorDescriptionKey";
NSString *MSALSTSErrorCodesKey = @"MSALSTSErrorCodesKey";
NSString *MSALInternalErrorCodeKey = @"MSALInternalErrorCodeKey";
NSString *MSALHTTPHeadersKey = @"MSALHTTPHeadersKey";
NSString *MSALHTTPResponseCodeKey = @"MSALHTTPResponseCodeKey";
Expand Down
9 changes: 7 additions & 2 deletions MSAL/src/MSALErrorConverter.m
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ + (void)initialize
MSIDHTTPResponseCodeKey : MSALHTTPResponseCodeKey,
MSIDCorrelationIdKey : MSALCorrelationIDKey,
MSIDErrorDescriptionKey : MSALErrorDescriptionKey,
MSIDSTSErrorCodesKey : MSALSTSErrorCodesKey,
MSIDOAuthErrorKey: MSALOAuthErrorKey,
MSIDOAuthSubErrorKey: MSALOAuthSubErrorKey,
MSIDDeclinedScopesKey: MSALDeclinedScopesKey,
Expand Down Expand Up @@ -249,8 +250,12 @@ + (NSError *)errorWithDomain:(NSString *)domain
if (errorDescription) msalUserInfo[MSALErrorDescriptionKey] = errorDescription;
if (oauthError) msalUserInfo[MSALOAuthErrorKey] = oauthError;
if (subError) msalUserInfo[MSALOAuthSubErrorKey] = subError;

if (underlyingError) msalUserInfo[NSUnderlyingErrorKey] = [MSALErrorConverter msalErrorFromMsidError:underlyingError];

if (underlyingError) {
msalUserInfo[NSUnderlyingErrorKey] = [MSALErrorConverter msalErrorFromMsidError:underlyingError];
NSArray<NSNumber *>* stsErrorCodes = underlyingError.userInfo[MSIDSTSErrorCodesKey];
if (stsErrorCodes) msalUserInfo[MSALSTSErrorCodesKey] = stsErrorCodes;
}

msalUserInfo[MSALInternalErrorCodeKey] = internalCode;

Expand Down
4 changes: 3 additions & 1 deletion MSAL/src/MSALPublicClientApplication.m
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ + (void)load
MSIDNotifications.webAuthDidFinishLoadNotificationName = MSALWebAuthDidFinishLoadNotification;
MSIDNotifications.webAuthWillSwitchToBrokerAppNotificationName = MSALWebAuthWillSwitchToBrokerApp;
MSIDNotifications.webAuthDidReceiveResponseFromBrokerNotificationName = MSALWebAuthDidReceiveResponseFromBroker;
#if TARGET_OS_IPHONE && !AD_BROKER
#if TARGET_OS_IPHONE && !AD_BROKER && !MSID_EXCLUDE_SYSTEMWV
[MSIDCertAuthHandler setUseAuthSession:YES];
#endif
}
Expand Down Expand Up @@ -621,6 +621,7 @@ + (BOOL)handleMSALResponse:(NSURL *)response
+ (BOOL)handleMSALResponse:(NSURL *)response
sourceApplication:(NSString *)sourceApplication
{
#if !MSID_EXCLUDE_SYSTEMWV
if ([MSIDWebviewAuthorization handleURLResponseForSystemWebviewController:response])
{
return YES;
Expand All @@ -630,6 +631,7 @@ + (BOOL)handleMSALResponse:(NSURL *)response
{
return YES;
}
#endif

// Only AAD is supported in broker at this time. If we need to support something else, we need to change this to dynamically read authority from response and create factory
MSIDDefaultBrokerResponseHandler *brokerResponseHandler = [[MSIDDefaultBrokerResponseHandler alloc] initWithOauthFactory:[MSIDAADV2Oauth2Factory new]
Expand Down
2 changes: 1 addition & 1 deletion MSAL/src/MSAL_Internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#define MSAL_VER_HIGH 1
#define MSAL_VER_LOW 5
#define MSAL_VER_PATCH 0
#define MSAL_VER_PATCH 1

#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
Expand Down
6 changes: 6 additions & 0 deletions MSAL/src/public/MSALError.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ extern NSString *MSALOAuthSubErrorKey;
*/
extern NSString *MSALErrorDescriptionKey;

/**
A list of STS-specific error codes returned by the service that can help in diagnostics. Note that error codes can change and should
not be relied upon for any error handling logic.
*/
extern NSString *MSALSTSErrorCodesKey;

/**
Internal error code returned together with MSALErrorInternal error.
*/
Expand Down
41 changes: 41 additions & 0 deletions MSAL/test/app/vision/ContentView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// Copyright (c) Microsoft Corporation.
// All rights reserved.
//
// This code is licensed under the MIT License.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions :
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.


import SwiftUI
import RealityKit

struct ContentView: View {
var body: some View {

VStack {
MSALTestAppView()
}

}
}

#Preview(windowStyle: .automatic) {
ContentView()
}
45 changes: 45 additions & 0 deletions MSAL/test/app/vision/MSALTestAppView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
//
// Copyright (c) Microsoft Corporation.
// All rights reserved.
//
// This code is licensed under the MIT License.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions :
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.


import SwiftUI

struct MSALTestAppView: UIViewControllerRepresentable {
typealias UIViewControllerType = MSALTestAppVisionViewController

func makeUIViewController(context: Context) -> MSALTestAppVisionViewController {
let vc = MSALTestAppVisionViewController()

return vc
}

func updateUIViewController(_ uiViewController: MSALTestAppVisionViewController, context: Context) {
// nothing for now
}

}

#Preview {
MSALTestAppView()
}
Loading

0 comments on commit 08dde01

Please sign in to comment.