Skip to content

Commit 5a86f34

Browse files
Kai SongKai Song
authored andcommitted
Update comment
1 parent 63478b0 commit 5a86f34

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

IdentityCore/src/util/MSIDXpcSingleSignOnProvider.m

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -148,19 +148,18 @@ - (void)handleRequestParam:(NSDictionary *)requestParam
148148

149149
+ (BOOL)canPerformRequest:(id<MSIDXpcProviderCaching>)xpcProviderCache
150150
{
151-
// Step 0: if none of the Xpc Component (CP or MacBroApp) exits on device, return false.
152-
// Step 1: read from userDefault cache to find the correct Xpc configuration based on active SsoExtension
153-
// Step 1.1: Xpc configuration found, validate the corresponding Xpc component existence based on the configuration
154-
// Step 1.1.1: Xpc component does not exit on device, return false (This is unlikely to happen)
155-
// Step 1.1.2: Xpc component exits on device, Step 2.
156-
// Step 1.2: cache not found, handshake to SsoExtension (canPerformRequest -> getDeviceInfo)
157-
// Step 1.2.1: handshake succeeded, update the Xpc provider cache and configuration, and go to Step 1.1
158-
// Step 1.2.2: handshake failed due to canPerformRequest returns NO, use predefined logic to decide Xpc provider/configuration (user Xpc Componenet from MacBroker App then from CompanyPortal App)
159-
// Step 1.2.2.1: if use Xpc provider from MacBroker App and go to Step 2.
160-
// Step 1.2.2.2: If use Xpc provider from CompanyPortal App and Step 2.
161-
// Step 2: Check canPerformRequest from XPC service
151+
// Step 0: If none of the XPC components (CP or MacBrokerApp) exist on the device, return false.
152+
// Step 1: Read from the userDefaults cache to find the correct XPC configuration based on the active SsoExtension.
153+
// Step 1.1: If the XPC configuration is found, validate the existence of the corresponding XPC component based on the configuration.
154+
// Step 1.1.1: If the XPC component no longer exists on the device, return false (this is unlikely to happen in a short time period).
155+
// Step 1.1.2: If the XPC component exists on the device, proceed to Step 2.
156+
// Step 1.2: If the cache is not found, perform a handshake with the SsoExtension (canPerformRequest -> getDeviceInfo).
157+
// Step 1.2.1: If the handshake succeeds, update the XPC provider cache and configuration, then go to Step 1.1.
158+
// Step 1.2.2: If the handshake fails because canPerformRequest returns NO, use predefined logic to decide the XPC provider/configuration (use the XPC component from the MacBrokerApp first, then from the CompanyPortal App).
159+
// Step 1.2.2.1: If using the XPC provider from the MacBroker App, proceed to Step 2.
160+
// Step 1.2.2.2: If using the XPC provider from the CompanyPortal App, proceed to Step 2.
161+
// Step 2: Check canPerformRequest from the XPC service.
162162
// XPC status caching logic: https://microsoft-my.sharepoint-df.com/:w:/p/kasong/EeTyTIf6TbNIvquOtT80q6kBr38-nRx1Q_ssIxDzVXg88w?e=tG63sP
163-
// In case the SsoExtension provider identifier changed, the code should invalid the XPC status and call canPerformRequest based on the new XPC Provider
164163

165164
/* Step 0 Start*/
166165
if (!xpcProviderCache.isXpcProviderInstalledOnDevice)
@@ -239,7 +238,7 @@ + (BOOL)canPerformRequest:(id<MSIDXpcProviderCaching>)xpcProviderCache
239238
__block BOOL result = NO;
240239
MSIDXpcSingleSignOnProvider *xpcSingleSignOnProvider = [MSIDXpcSingleSignOnProvider new];
241240

242-
// Check canPerformAuthorization through real broker XPC service
241+
// Check canPerformAuthorization through real broker Xpc service
243242
[xpcSingleSignOnProvider getXpcService:xpcProviderCache withContinueBlock:^(id<MSIDXpcBrokerInstanceProtocol> __unused xpcService, NSXPCConnection *directConnection, NSError *error)
244243
{
245244
if (!xpcService || error)

0 commit comments

Comments
 (0)