Skip to content

Commit 2303514

Browse files
authored
Merge pull request #1593 from AzureAD/josephpab/dunaOnMac
Allow duna on Mac OS
2 parents 5d91da8 + c90ef0a commit 2303514

File tree

10 files changed

+27
-20
lines changed

10 files changed

+27
-20
lines changed

IdentityCore/IdentityCore.xcodeproj/project.pbxproj

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,9 @@
566566
4B6D222E2E8342C200546EC8 /* MSIDFlightManagerQueryKeyType.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B6D222B2E8342C200546EC8 /* MSIDFlightManagerQueryKeyType.m */; };
567567
4BADFA5E2E85D7FC00E8C26F /* MSIDFlightManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BADFA5D2E85D7EC00E8C26F /* MSIDFlightManagerTests.swift */; };
568568
4BADFA5F2E85D7FC00E8C26F /* MSIDFlightManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BADFA5D2E85D7EC00E8C26F /* MSIDFlightManagerTests.swift */; };
569+
4BF51DD42E96DAC700434A36 /* MSIDSwitchBrowserResumeOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 235C2B002D6FAF7900DEFEFB /* MSIDSwitchBrowserResumeOperation.m */; };
570+
4BF51DD52E96DACD00434A36 /* MSIDSwitchBrowserOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 235C2AFE2D6FAF7900DEFEFB /* MSIDSwitchBrowserOperation.m */; };
571+
4BF51DD62E96E0AC00434A36 /* MSIDCertAuthManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 2394F19F2D2866F700E44F6E /* MSIDCertAuthManager.m */; };
569572
580E25402719FD10003D1795 /* MSIDPrtHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = 580E253E2719FD10003D1795 /* MSIDPrtHeader.h */; };
570573
580E25412719FD10003D1795 /* MSIDPrtHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 580E253F2719FD10003D1795 /* MSIDPrtHeader.m */; };
571574
580E25422719FD10003D1795 /* MSIDPrtHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 580E253F2719FD10003D1795 /* MSIDPrtHeader.m */; };
@@ -3802,17 +3805,6 @@
38023805
path = error_handler;
38033806
sourceTree = "<group>";
38043807
};
3805-
235C2B012D6FAF7900DEFEFB /* ios */ = {
3806-
isa = PBXGroup;
3807-
children = (
3808-
235C2AFD2D6FAF7900DEFEFB /* MSIDSwitchBrowserOperation.h */,
3809-
235C2AFE2D6FAF7900DEFEFB /* MSIDSwitchBrowserOperation.m */,
3810-
235C2AFF2D6FAF7900DEFEFB /* MSIDSwitchBrowserResumeOperation.h */,
3811-
235C2B002D6FAF7900DEFEFB /* MSIDSwitchBrowserResumeOperation.m */,
3812-
);
3813-
path = ios;
3814-
sourceTree = "<group>";
3815-
};
38163808
23642AB32187D88C00F97009 /* mocks */ = {
38173809
isa = PBXGroup;
38183810
children = (
@@ -4233,7 +4225,10 @@
42334225
58B81F7F24AD0F7700E8799E /* operations */ = {
42344226
isa = PBXGroup;
42354227
children = (
4236-
235C2B012D6FAF7900DEFEFB /* ios */,
4228+
235C2AFD2D6FAF7900DEFEFB /* MSIDSwitchBrowserOperation.h */,
4229+
235C2AFE2D6FAF7900DEFEFB /* MSIDSwitchBrowserOperation.m */,
4230+
235C2AFF2D6FAF7900DEFEFB /* MSIDSwitchBrowserResumeOperation.h */,
4231+
235C2B002D6FAF7900DEFEFB /* MSIDSwitchBrowserResumeOperation.m */,
42374232
58B81F7A24AD0E7A00E8799E /* MSIDWebResponseOperationFactory.h */,
42384233
58B81F7B24AD0E7A00E8799E /* MSIDWebResponseOperationFactory.m */,
42394234
58B81F8024AD0F8B00E8799E /* MSIDWebResponseBaseOperation.h */,
@@ -7400,6 +7395,7 @@
74007395
B297E1ED20A1388E00F370EC /* MSIDDefaultAccountCacheQuery.m in Sources */,
74017396
235480CC20DDF81000246F72 /* MSIDB2CAuthority.m in Sources */,
74027397
B26A0B842071B6CC006BD95A /* MSIDAADOauth2Factory.m in Sources */,
7398+
4BF51DD62E96E0AC00434A36 /* MSIDCertAuthManager.m in Sources */,
74037399
23B39A8D209A53B7000AA905 /* MSIDDRSDiscoveryRequest.m in Sources */,
74047400
23B39A8820993572000AA905 /* MSIDAADAuthorityMetadataRequest.m in Sources */,
74057401
B49323932AD491CF00E0CBC0 /* MSIDBrokerOperationPasskeyAssertionRequest.m in Sources */,
@@ -7494,6 +7490,7 @@
74947490
2306D2A020AB672A00F875A3 /* MSIDAADEndpointProvider.m in Sources */,
74957491
B49323972AD4DA2A00E0CBC0 /* MSIDBrokerOperationGetPasskeyAssertionResponse.m in Sources */,
74967492
B251CC4B204105A7005E0179 /* MSIDBaseToken.m in Sources */,
7493+
4BF51DD52E96DACD00434A36 /* MSIDSwitchBrowserOperation.m in Sources */,
74977494
235480D120DDF81000246F72 /* MSIDADFSAuthority.m in Sources */,
74987495
23391BD82B17F2FD00EB121B /* MSIDBrowserNativeMessageSignOutRequest.m in Sources */,
74997496
B2EF143B1FF2F228005DC1C0 /* MSIDAADV2TokenResponse.m in Sources */,
@@ -7612,6 +7609,7 @@
76127609
B286B9A42389DCEB007833AD /* MSIDSSOExtensionSilentTokenRequestController.m in Sources */,
76137610
B2C7B3BC213C69C8009FFCC1 /* MSIDDefaultErrorConverter.m in Sources */,
76147611
A0E541B125CDC5F10016E167 /* MSIDThrottlingMetaData.m in Sources */,
7612+
4BF51DD42E96DAC700434A36 /* MSIDSwitchBrowserResumeOperation.m in Sources */,
76157613
B443F0032AD6328700782168 /* MSIDBrokerOperationPasskeyCredentialRequest.m in Sources */,
76167614
B27ACAAA22EE9FE60049ACE0 /* MSIDIntuneApplicationStateManager.m in Sources */,
76177615
729358112DDFADE70001D03C /* MSIDNonceHttpRequest.m in Sources */,

IdentityCore/src/oauth2/aad_base/MSIDAADWebviewFactory.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ - (BOOL)isDUNASupportedForTenantId:(NSString *)tenantId
113113
result[@"haschrome"] = @"1";
114114
[result addEntriesFromDictionary:MSIDDeviceId.deviceId];
115115

116-
#if TARGET_OS_IPHONE
116+
#if TARGET_OS_IPHONE || TARGET_OS_OSX
117117
NSString *tenantId = parameters.accountIdentifier.utid;
118118
if ([self isDUNASupportedForTenantId:tenantId])
119119
{
@@ -231,10 +231,8 @@ - (MSIDWebviewResponse *)oAuthResponseWithURL:(NSURL *)url
231231
context:context
232232
error:nil];
233233
if (browserResponse) return browserResponse;
234-
235-
NSString *tenantId = wpjResponse.clientInfo.utid;
236-
237-
if ([self isDUNASupportedForTenantId:tenantId])
234+
235+
if ([self isDUNASupportedForTenantId:nil])
238236
{
239237
MSIDSwitchBrowserResponse *switchBrowserResponse = [[MSIDSwitchBrowserResponse alloc] initWithURL:url
240238
redirectUri:endRedirectUri

IdentityCore/src/webview/MSIDCertAuthManager.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,19 @@ NS_ASSUME_NONNULL_BEGIN
3333

3434
+ (instancetype)sharedInstance;
3535

36-
#if TARGET_OS_IPHONE && !MSID_EXCLUDE_SYSTEMWV
36+
#if (TARGET_OS_IPHONE || TARGET_OS_OSX) && !MSID_EXCLUDE_SYSTEMWV
3737

3838
@property (nonatomic) BOOL useAuthSession;
3939
@property (nonatomic, readonly) BOOL isCertAuthInProgress;
4040
@property (nonatomic, readonly) NSString *redirectPrefix;
41-
@property (nonatomic, readonly) NSString *redirectScheme;;
41+
@property (nonatomic, readonly) NSString *redirectScheme;
42+
43+
#if TARGET_OS_IPHONE
4244
@property (nonatomic) NSArray<UIActivity *> *activities;
45+
#else
46+
// macOS equivalent
47+
@property (nonatomic) NSArray<NSSharingService *> *activities;
48+
#endif
4349

4450
- (void)startWithURL:(NSURL *)startURL
4551
parentController:(MSIDViewController *)parentViewController

IdentityCore/src/webview/MSIDCertAuthManager.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ + (instancetype)sharedInstance
5050
return sharedInstance;
5151
}
5252

53-
#if TARGET_OS_IPHONE && !MSID_EXCLUDE_SYSTEMWV
53+
#if (TARGET_OS_IPHONE || TARGET_OS_OSX) && !MSID_EXCLUDE_SYSTEMWV
5454

5555
- (void)setRedirectUriPrefix:(NSString *)prefix
5656
forScheme:(NSString *)scheme

IdentityCore/src/webview/operations/ios/MSIDSwitchBrowserOperation.h renamed to IdentityCore/src/webview/operations/MSIDSwitchBrowserOperation.h

File renamed without changes.

IdentityCore/src/webview/operations/ios/MSIDSwitchBrowserOperation.m renamed to IdentityCore/src/webview/operations/MSIDSwitchBrowserOperation.m

File renamed without changes.

IdentityCore/src/webview/operations/ios/MSIDSwitchBrowserResumeOperation.h renamed to IdentityCore/src/webview/operations/MSIDSwitchBrowserResumeOperation.h

File renamed without changes.

IdentityCore/src/webview/operations/ios/MSIDSwitchBrowserResumeOperation.m renamed to IdentityCore/src/webview/operations/MSIDSwitchBrowserResumeOperation.m

File renamed without changes.

IdentityCore/src/webview/systemWebview/session/MSIDSystemWebviewController.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
#if TARGET_OS_IPHONE
5353
@property (nonatomic) UIModalPresentationStyle presentationType;
5454
@property (nonatomic) NSArray<UIActivity *> *appActivities;
55+
#else
56+
@property (nonatomic) NSArray<NSSharingService *> *appActivities;
5557
#endif
5658

5759
+ (instancetype)sharedController;

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## [TBD]
2+
* Allow duna external idp on MacOs #1593
3+
14
Version 1.15.1
25
* Allow cookies in duna resume request #1574
36

0 commit comments

Comments
 (0)