Skip to content

Commit 1bfd768

Browse files
authored
Merge pull request #2508 from AzureAD/sedemche/duna_cba
Support DUNA protocol for CBA flow
2 parents 8ed4d9d + 67fe21c commit 1bfd768

File tree

6 files changed

+41
-18
lines changed

6 files changed

+41
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## TBD
22
* Support sendable result #2518
3+
* Support DUNA protocol for CBA flow #2508
34

45
## [1.7.0]
56
* Add support for claims request in native authentication signIn (#2496)

MSAL/IdentityCore

Submodule IdentityCore updated 59 files

MSAL/MSAL.xcodeproj/project.pbxproj

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5811,8 +5811,6 @@
58115811
};
58125812
D61A64321E5A29580086D120 = {
58135813
CreatedOnToolsVersion = 8.2.1;
5814-
DevelopmentTeam = UBF8T346G9;
5815-
ProvisioningStyle = Manual;
58165814
SystemCapabilities = {
58175815
com.apple.Keychain = {
58185816
enabled = 1;
@@ -8783,9 +8781,8 @@
87838781
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
87848782
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
87858783
CODE_SIGN_ENTITLEMENTS = "MSAL Test App.entitlements";
8786-
CODE_SIGN_IDENTITY = "iPhone Developer";
8787-
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
8788-
CODE_SIGN_STYLE = Manual;
8784+
CODE_SIGN_IDENTITY = "Apple Development";
8785+
CODE_SIGN_STYLE = Automatic;
87898786
DEVELOPMENT_TEAM = UBF8T346G9;
87908787
ENABLE_BITCODE = NO;
87918788
GCC_OPTIMIZATION_LEVEL = 0;
@@ -8797,7 +8794,7 @@
87978794
);
87988795
PRODUCT_BUNDLE_IDENTIFIER = com.microsoft.MSALTestApp;
87998796
PROVISIONING_PROFILE = "";
8800-
PROVISIONING_PROFILE_SPECIFIER = "iOS Team Provisioning Profile";
8797+
PROVISIONING_PROFILE_SPECIFIER = "";
88018798
USER_HEADER_SEARCH_PATHS = (
88028799
"$(inherited)",
88038800
"$IDCORE_PATH/src/**",

MSAL/MSAL.xcodeproj/xcshareddata/xcschemes/MSAL Test App (iOS).xcscheme

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
shouldUseLaunchSchemeArgsEnv = "YES">
30-
<Testables>
31-
</Testables>
3230
<MacroExpansion>
3331
<BuildableReference
3432
BuildableIdentifier = "primary"
@@ -38,8 +36,8 @@
3836
ReferencedContainer = "container:MSAL.xcodeproj">
3937
</BuildableReference>
4038
</MacroExpansion>
41-
<AdditionalOptions>
42-
</AdditionalOptions>
39+
<Testables>
40+
</Testables>
4341
</TestAction>
4442
<LaunchAction
4543
buildConfiguration = "Debug"
@@ -61,8 +59,6 @@
6159
ReferencedContainer = "container:MSAL.xcodeproj">
6260
</BuildableReference>
6361
</BuildableProductRunnable>
64-
<AdditionalOptions>
65-
</AdditionalOptions>
6662
</LaunchAction>
6763
<ProfileAction
6864
buildConfiguration = "Release"

MSAL/src/MSALPublicClientApplication.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
#import "MSALWebviewParameters.h"
9090
#import "MSIDAccountIdentifier.h"
9191
#if TARGET_OS_IPHONE
92-
#import "MSIDCertAuthHandler+iOS.h"
9392
#import "MSIDBrokerInteractiveController.h"
9493
#import <UIKit/UIKit.h>
9594
#else
@@ -113,6 +112,7 @@
113112
#import "MSALWipeCacheForAllAccountsConfig.h"
114113
#import "NSString+MSIDTelemetryExtensions.h"
115114
#import "MSIDVersion.h"
115+
#import "MSIDCertAuthManager.h"
116116

117117
@interface MSALPublicClientApplication()
118118
{
@@ -142,7 +142,7 @@ + (void)load
142142
MSIDNotifications.webAuthWillSwitchToBrokerAppNotificationName = MSALWebAuthWillSwitchToBrokerApp;
143143
MSIDNotifications.webAuthDidReceiveResponseFromBrokerNotificationName = MSALWebAuthDidReceiveResponseFromBroker;
144144
#if TARGET_OS_IPHONE && !AD_BROKER && !MSID_EXCLUDE_SYSTEMWV
145-
[MSIDCertAuthHandler setUseAuthSession:YES];
145+
MSIDCertAuthManager.sharedInstance.useAuthSession = YES;
146146
#endif
147147
}
148148

@@ -626,8 +626,8 @@ + (BOOL)handleMSALResponse:(NSURL *)response
626626
{
627627
return YES;
628628
}
629-
630-
if ([MSIDCertAuthHandler completeCertAuthChallenge:response])
629+
630+
if ([MSIDCertAuthManager.sharedInstance completeWithCallbackURL:response])
631631
{
632632
return YES;
633633
}

MSAL/test/unit/MSALAcquireTokenTests.m

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@
8484
#import "MSALSilentTokenParameters.h"
8585
#import "XCTestCase+HelperMethods.h"
8686
#import "MSIDLRUCache.h"
87+
#import "MSIDFlightManager.h"
88+
#import "MSIDConstants.h"
8789

8890
#pragma clang diagnostic push
8991
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@@ -654,6 +656,12 @@ - (void)testAcquireTokenInteractive_whenClaimsIsPassedViaOverloadedAcquireToken_
654656
} mutableCopy];
655657
[expectedQPs addEntriesFromDictionary:[MSIDDeviceId deviceId]];
656658
[expectedQPs addEntriesFromDictionary: [self getAppMetadata]];
659+
660+
if ([MSIDFlightManager.sharedInstance boolForKey:MSID_FLIGHT_SUPPORT_DUNA_CBA])
661+
{
662+
expectedQPs[@"switch_browser"] = @"1";
663+
}
664+
657665
XCTAssertTrue([expectedQPs compareAndPrintDiff:QPs]);
658666

659667
NSString *responseString = [NSString stringWithFormat:UNIT_TEST_DEFAULT_REDIRECT_URI"?code=%@&state=%@&client_info=%@", @"iamauthcode", QPs[@"state"], @"eyJ1aWQiOiI5ZjQ4ODBkOC04MGJhLTRjNDAtOTdiYy1mN2EyM2M3MDMwODQiLCJ1dGlkIjoiZjY0NWFkOTItZTM4ZC00ZDFhLWI1MTAtZDFiMDlhNzRhOGNhIn0"];
@@ -947,6 +955,11 @@ - (void)testAcquireTokenInteractive_whenCapabilitiesSet_shouldSendCapabilitiesTo
947955
} mutableCopy];
948956
[expectedQPs addEntriesFromDictionary:[MSIDDeviceId deviceId]];
949957
[expectedQPs addEntriesFromDictionary: [self getAppMetadata]];
958+
959+
if ([MSIDFlightManager.sharedInstance boolForKey:MSID_FLIGHT_SUPPORT_DUNA_CBA])
960+
{
961+
expectedQPs[@"switch_browser"] = @"1";
962+
}
950963

951964
XCTAssertTrue([expectedQPs compareAndPrintDiff:QPs]);
952965

@@ -1043,7 +1056,12 @@ - (void)testAcquireTokenInteractive_whenClaimsIsPassedAndCapabilitiesSet_shouldS
10431056
} mutableCopy];
10441057
[expectedQPs addEntriesFromDictionary:[MSIDDeviceId deviceId]];
10451058
[expectedQPs addEntriesFromDictionary: [self getAppMetadata]];
1046-
1059+
1060+
if ([MSIDFlightManager.sharedInstance boolForKey:MSID_FLIGHT_SUPPORT_DUNA_CBA])
1061+
{
1062+
expectedQPs[@"switch_browser"] = @"1";
1063+
}
1064+
10471065
XCTAssertTrue([expectedQPs compareAndPrintDiff:QPs]);
10481066

10491067
NSString *responseString = [NSString stringWithFormat:UNIT_TEST_DEFAULT_REDIRECT_URI"?code=%@&state=%@&client_info=%@", @"iamauthcode", QPs[@"state"], @"eyJ1aWQiOiI5ZjQ4ODBkOC04MGJhLTRjNDAtOTdiYy1mN2EyM2M3MDMwODQiLCJ1dGlkIjoiZjY0NWFkOTItZTM4ZC00ZDFhLWI1MTAtZDFiMDlhNzRhOGNhIn0"];
@@ -1140,6 +1158,12 @@ - (void)testAcquireTokenInteractive_whenClaimsIsPassedAndLoginHintNotNil_shouldS
11401158
} mutableCopy];
11411159
[expectedQPs addEntriesFromDictionary:[MSIDDeviceId deviceId]];
11421160
[expectedQPs addEntriesFromDictionary:[self getAppMetadata]];
1161+
1162+
if ([MSIDFlightManager.sharedInstance boolForKey:MSID_FLIGHT_SUPPORT_DUNA_CBA])
1163+
{
1164+
expectedQPs[@"switch_browser"] = @"1";
1165+
}
1166+
11431167
XCTAssertTrue([expectedQPs compareAndPrintDiff:QPs]);
11441168

11451169
NSString *responseString = [NSString stringWithFormat:UNIT_TEST_DEFAULT_REDIRECT_URI"?code=%@&state=%@&client_info=%@", @"iamanauthcode", QPs[@"state"], @"eyJ1aWQiOiI5ZjQ4ODBkOC04MGJhLTRjNDAtOTdiYy1mN2EyM2M3MDMwODQiLCJ1dGlkIjoiZjY0NWFkOTItZTM4ZC00ZDFhLWI1MTAtZDFiMDlhNzRhOGNhIn0"];
@@ -1237,6 +1261,11 @@ - (void)testAcquireTokenInteractive_whenInstanceAware_shouldReturnCloudAuthority
12371261
} mutableCopy];
12381262
[expectedQPs addEntriesFromDictionary:[MSIDDeviceId deviceId]];
12391263
[expectedQPs addEntriesFromDictionary: [self getAppMetadata]];
1264+
1265+
if ([MSIDFlightManager.sharedInstance boolForKey:MSID_FLIGHT_SUPPORT_DUNA_CBA])
1266+
{
1267+
expectedQPs[@"switch_browser"] = @"1";
1268+
}
12401269

12411270
XCTAssertTrue([expectedQPs compareAndPrintDiff:QPs]);
12421271

0 commit comments

Comments
 (0)