B2C 自定义策略 - SubJourney OutputClaims 是否可以在父 UserJourney 中访问

Jon*_*roy 4 azure-ad-b2c identity-experience-framework azure-ad-b2c-custom-policy

关于子旅程的文档似乎有限。https://learn.microsoft.com/en-us/azure/active-directory-b2c/subjourneys

我在 SubJourney 中遇到一个问题,我读取用户并获取对象 ID。在主 UserJourney 中,我后来使用该对象 Id 再次读取用户,但它抱怨。

错误图像

尽管 objectId 是子旅程第一步中的输出声明,但主用户旅程无法使用该输出。

<SubJourneys>
        <SubJourney Id="ResetPhoneNumberOnAccount" Type="Call">
            <OrchestrationSteps>
                <!-- Look to see if the user exists if its a phone recovery -->
                <OrchestrationStep Order="1" Type="ClaimsExchange">
                    <ClaimsExchanges>
                        <ClaimsExchange Id="CheckIfUserExists" TechnicalProfileReferenceId="AAD-UserDiscoveryUsingLogonPhoneNumber-FullProfile" />
                    </ClaimsExchanges>
                </OrchestrationStep>
           <!-- Other Step -->
    </SubJourney>
</SubJourneys>

Run Code Online (Sandbox Code Playgroud)

AAD-UserDiscoveryUsingLogonPhoneNumber-FullProfile 定义:https://github.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack/blob/master/scenarios/phone-number-passwordless/Phone_Email_Base.xml#L905

SubJourneys 是否无法向链上发送输出声明?

小智 5

是的,子旅程中编排步骤的输出声明可以从父用户旅程访问。看起来,当编排步骤依赖于从子旅程返回的输出声明时,该步骤本身必须封装在自己的子旅程中。

如果主旅程中存在 AAD-UserReadUsingObjectId,但 objectId 仅在子旅程中输出,则策略将无法验证。在我看来,这是 XML 模式验证器的错误。

我已经检查了应用程序见解中的跟踪日志,并且在应用此解决方法后,可以确认子旅程中的索赔输出确实持续存在,直到主旅程结束。

要更深入地了解这个问题,请查看我在 GitHub 上的问题