Azure B2C:如何仅显示静态 HTML 页面?
Azure B2C: How to show a static HTML page only?
我正在修改现有自定义策略的行为,但尚未找到有关我尝试执行的操作的指导。
背景
我有一个带有条款和条件页面的自定义 signup/signin 政策。一般工作流程是:
- 注册/登录
- 接受条款和条件
- 将声明发送回 Web 应用程序,让用户登录
目标
我被要求修改策略,以便在登录时显示自定义 HTML“待验证页面”而不是重定向回 Web 应用程序。
我做了什么
- 创建并部署了自定义 HTML 内容。
- 创建了指向 HTML 页面的
ContentDefinition
:
<ContentDefinition Id="api.selfasserted.pendingverification">
<LoadUri>[redacted]/pending-verification.html</LoadUri>
<RecoveryUri>~/common/default_page_error.html</RecoveryUri>
<DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:1.2.0</DataUri>
<Metadata>
<Item Key="DisplayName">Pending Verification</Item>
</Metadata>
</ContentDefinition>
- 创建了一个使用该内容定义的
TechnicalProfile
:
<TechnicalProfile Id="SelfAsserted-PendingVerification">
<DisplayName>Pending Verification</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Metadata>
<Item Key="ContentDefinitionReferenceId">api.selfasserted.pendingverification</Item>
</Metadata>
<IncludeInSso>false</IncludeInSso>
</TechnicalProfile>
- 添加了引用
TechnicalProfile
的 OrchestrationStep
:
<OrchestrationStep Order="6" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="ShowPendingVerificationPage" TechnicalProfileReferenceId="SelfAsserted-PendingVerification" />
</ClaimsExchanges>
</OrchestrationStep>
- 仔细检查步骤的顺序是否符合我的预期,并且编排中没有任何步骤共享相同的顺序号。
挑战
尽管执行了这些步骤,但似乎每次都跳过了待验证页面,并且似乎执行了下一步(returns 声明)。
问题
- 我对上面如何创建和引用静态页面的理解是否正确?
- 是否默认跳过没有输入或输出声明的技术配置文件?
- 以这种方式显示静态 HTML 文件而不继续进行编排中的下一步的正确方法是什么?
你是对的。如果没有指定声明,将跳过 ClaimsExchange
编排步骤。
在我见过的例子中,许多人通过 UserInputType
为 Readonly
的声明实现了这一点。
我不知道其他任何事情,没有更复杂的 Javascript 来移入和移出内容。
我正在修改现有自定义策略的行为,但尚未找到有关我尝试执行的操作的指导。
背景
我有一个带有条款和条件页面的自定义 signup/signin 政策。一般工作流程是:
- 注册/登录
- 接受条款和条件
- 将声明发送回 Web 应用程序,让用户登录
目标
我被要求修改策略,以便在登录时显示自定义 HTML“待验证页面”而不是重定向回 Web 应用程序。
我做了什么
- 创建并部署了自定义 HTML 内容。
- 创建了指向 HTML 页面的
ContentDefinition
:
<ContentDefinition Id="api.selfasserted.pendingverification">
<LoadUri>[redacted]/pending-verification.html</LoadUri>
<RecoveryUri>~/common/default_page_error.html</RecoveryUri>
<DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:1.2.0</DataUri>
<Metadata>
<Item Key="DisplayName">Pending Verification</Item>
</Metadata>
</ContentDefinition>
- 创建了一个使用该内容定义的
TechnicalProfile
:
<TechnicalProfile Id="SelfAsserted-PendingVerification">
<DisplayName>Pending Verification</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Metadata>
<Item Key="ContentDefinitionReferenceId">api.selfasserted.pendingverification</Item>
</Metadata>
<IncludeInSso>false</IncludeInSso>
</TechnicalProfile>
- 添加了引用
TechnicalProfile
的OrchestrationStep
:
<OrchestrationStep Order="6" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="ShowPendingVerificationPage" TechnicalProfileReferenceId="SelfAsserted-PendingVerification" />
</ClaimsExchanges>
</OrchestrationStep>
- 仔细检查步骤的顺序是否符合我的预期,并且编排中没有任何步骤共享相同的顺序号。
挑战
尽管执行了这些步骤,但似乎每次都跳过了待验证页面,并且似乎执行了下一步(returns 声明)。
问题
- 我对上面如何创建和引用静态页面的理解是否正确?
- 是否默认跳过没有输入或输出声明的技术配置文件?
- 以这种方式显示静态 HTML 文件而不继续进行编排中的下一步的正确方法是什么?
你是对的。如果没有指定声明,将跳过 ClaimsExchange
编排步骤。
在我见过的例子中,许多人通过 UserInputType
为 Readonly
的声明实现了这一点。
我不知道其他任何事情,没有更复杂的 Javascript 来移入和移出内容。