Skip to content

Commit 39a1b0f

Browse files
author
kai
committed
Expose window anchor directly through MSAL API
1 parent b4b4a73 commit 39a1b0f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

MSAL/src/MSALPublicClientApplication.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,7 @@ - (void)acquireTokenWithParameters:(MSALInteractiveTokenParameters *)parameters
12051205
msidParams.currentRequestTelemetry.schemaVersion = HTTP_REQUEST_TELEMETRY_SCHEMA_VERSION;
12061206
msidParams.currentRequestTelemetry.apiId = [msidParams.telemetryApiId integerValue];
12071207
msidParams.currentRequestTelemetry.tokenCacheRefreshType = TokenCacheRefreshTypeNoCacheLookupInvolved;
1208+
msidParams.presentationAnchorWindow= parameters.windowAnchor;
12081209

12091210
MSIDAccountMetadataState signInState = [self accountStateForParameters:msidParams error:nil];
12101211

MSAL/src/public/MSALInteractiveTokenParameters.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ NS_ASSUME_NONNULL_BEGIN
6868
*/
6969
@property (nonatomic, readonly, copy) MSALWebviewParameters *webviewParameters;
7070

71+
/**
72+
The window anchor for presenting SsoExtension on iOS and macOS.
73+
Without providing window anchor or the parentViewController from MSALWebviewParameters will result unexpected SsoExtension behavior
74+
*/
75+
#if TARGET_OS_IPHONE
76+
@property (nonatomic, readonly, copy) UIWindow *windowAnchor;
77+
#else
78+
@property (nonatomic, readonly, copy) NSWindow *windowAnchor;
79+
#endif
80+
7181
#if TARGET_OS_IPHONE
7282

7383
/**

0 commit comments

Comments
 (0)