Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MSAL/IdentityCore
Submodule IdentityCore updated 24 files
+34 −8 IdentityCore/IdentityCore.xcodeproj/project.pbxproj
+3 −0 IdentityCore/src/MSIDError.h
+3 −0 IdentityCore/src/MSIDError.m
+54 −4 IdentityCore/src/controllers/MSIDRequestControllerFactory.m
+2 −2 IdentityCore/src/controllers/MSIDSilentController.m
+41 −0 IdentityCore/src/controllers/broker/mac/MSIDXpcInteractiveTokenRequestController.h
+125 −0 IdentityCore/src/controllers/broker/mac/MSIDXpcInteractiveTokenRequestController.m
+2 −1 IdentityCore/src/controllers/broker/mac/MSIDXpcSilentTokenRequestController.m
+2 −2 IdentityCore/src/requests/broker/MSIDSSOExtensionInteractiveTokenRequest.h
+24 −100 IdentityCore/src/requests/broker/MSIDSSOExtensionInteractiveTokenRequest.m
+38 −0 IdentityCore/src/requests/broker/MSIDSSORemoteInteractiveTokenRequest.h
+156 −0 IdentityCore/src/requests/broker/MSIDSSORemoteInteractiveTokenRequest.m
+10 −10 IdentityCore/src/requests/broker/MSIDSSORemoteSilentTokenRequest.m
+34 −0 IdentityCore/src/requests/broker/mac/MSIDSSOXpcInteractiveTokenRequest.h
+114 −0 IdentityCore/src/requests/broker/mac/MSIDSSOXpcInteractiveTokenRequest.m
+1 −1 IdentityCore/src/requests/broker/mac/MSIDSSOXpcSilentTokenRequest.m
+2 −0 IdentityCore/src/requests/sdk/MSIDTokenRequestProviding.h
+6 −0 IdentityCore/src/requests/sdk/adal/MSIDLegacyTokenRequestProvider.m
+17 −1 IdentityCore/src/requests/sdk/msal/MSIDDefaultTokenRequestProvider.m
+21 −8 IdentityCore/src/util/mac/MSIDXpcSingleSignOnProvider.m
+312 −0 IdentityCore/tests/MSIDRequestControllerFactoryTests.m
+4 −0 IdentityCore/tests/mocks/MSIDTestTokenRequestProvider.m
+11 −11 azure_pipelines/verify_msalcpp_per_pr_ios.yml
+11 −11 azure_pipelines/verify_msalcpp_per_pr_mac.yml
7 changes: 4 additions & 3 deletions MSAL/MSAL.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5959,7 +5959,6 @@
};
1E614BD922558D8300EBF62F = {
CreatedOnToolsVersion = 10.1;
DevelopmentTeam = UBF8T346G9;
SystemCapabilities = {
com.apple.Keychain = {
enabled = 0;
Expand Down Expand Up @@ -8011,12 +8010,13 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = test/app/mac/MSALMacTestApp.entitlements;
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = UBF8T346G9;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -8084,12 +8084,13 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = test/app/mac/MSALMacTestApp.entitlements;
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = UBF8T346G9;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand Down
20 changes: 20 additions & 0 deletions MSAL/src/MSALPublicClientApplication.m
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,16 @@ - (void)acquireTokenSilentWithParameters:(MSALSilentTokenParameters *)parameters
msidParams.validateAuthority = shouldValidate;
msidParams.extendedLifetimeEnabled = self.internalConfig.extendedLifetimeEnabled;
msidParams.clientCapabilities = self.internalConfig.clientApplicationCapabilities;
#if TARGET_OS_OSX && DEBUG
msidParams.xpcMode = (NSUInteger)parameters.msalXpcMode;
#elif TARGET_OS_OSX
if (parameters.msalXpcMode == MSALXpcModeOverride)
{
parameters.msalXpcMode = MSALXpcModeDisable;
}

msidParams.xpcMode = (NSUInteger)parameters.msalXpcMode;
#endif

// Extra parameters to be added to the /token endpoint.
msidParams.extraTokenRequestParameters = self.internalConfig.extraQueryParameters.extraTokenURLParameters;
Expand Down Expand Up @@ -1064,6 +1074,16 @@ - (void)acquireTokenWithParameters:(MSALInteractiveTokenParameters *)parameters
msidParams.currentRequestTelemetry.schemaVersion = HTTP_REQUEST_TELEMETRY_SCHEMA_VERSION;
msidParams.currentRequestTelemetry.apiId = [msidParams.telemetryApiId integerValue];
msidParams.currentRequestTelemetry.tokenCacheRefreshType = TokenCacheRefreshTypeNoCacheLookupInvolved;
#if TARGET_OS_OSX && DEBUG
msidParams.xpcMode = (NSUInteger)parameters.msalXpcMode;
#elif TARGET_OS_OSX
if (parameters.msalXpcMode == MSALXpcModeOverride)
{
parameters.msalXpcMode = MSALXpcModeDisable;
}

msidParams.xpcMode = (NSUInteger)parameters.msalXpcMode;
#endif

#if TARGET_OS_OSX
msidParams.clientSku = MSID_CLIENT_SKU_MSAL_OSX;
Expand Down
31 changes: 31 additions & 0 deletions MSAL/src/public/MSALDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,37 @@ typedef NS_ENUM(NSUInteger, MSALPreferredAuthMethod)
MSALPreferredAuthMethodNone
};

#if TARGET_OS_OSX

/**
Preferred Xpc mode for MSAL requests. Can be configured by developers MSAL integration
*/
typedef NS_ENUM(NSUInteger, MSALXpcMode)
{
/*
Broker Xpc service call is disabled
*/
MSALXpcModeDisable,
/*
Broker Xpc service call is only used as a backup service when SsoExtension service failed.
If SsoExtenion is not available on the device (canPerformRequest returns false), Broker Xpc service call will be disabled
*/
MSALXpcModeBackup,
/*
Broker Xpc service call is used as a backup call when SsoExtension service failed.
If SsoExtenion is not available on the device, Xpc service call will be the primary auth service
*/
MSALXpcModeFull,

/*
Development only: Broker Xpc service is used as main Sso service, and ignored SsoExtension service completely.
This option will be ignored if used in production and will be treated same as MSALXpcModeDisable
*/
MSALXpcModeOverride
};

#endif

/**
The block that gets invoked after MSAL has finished getting a token silently or interactively.
@param result Represents information returned to the application after a successful interactive or silent token acquisition. See `MSALResult` for more information.
Expand Down
10 changes: 10 additions & 0 deletions MSAL/src/public/MSALTokenParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic, nullable) id<MSALAuthenticationSchemeProtocol> authenticationScheme;

#if TARGET_OS_OSX

/**
Broker Xpc service mode defined by developer. This service can be used a backup service on top of today's Entra ID SingleSignOn extension or an isolated service if tenant has no Entra ID SingleSignOn extension deployed
*/

@property (nonatomic) MSALXpcMode msalXpcMode;

#endif

#pragma mark - Creating MSALTokenParameters

/**
Expand Down
Loading
Loading