如何在 Azure AD B2C 中创建自定义错误页面 |自定义策略
How to Create a Custom Error Page in Azure AD B2C | Custom Policies
使用custom policies时,如何指定<UserJourney>
的错误页面?根据 TFP 基础 xml 文件中的值,我原以为它会是 <RecoveryUri>
,但这是行不通的。
<ContentDefinition Id="api.signuporsignin-ext-local">
<!-- <LoadUri>~/tenant/default/unified.cshtml</LoadUri> -->
<LoadUri>https://localhost:44377/</LoadUri>
<!-- <RecoveryUri>~/common/default_page_error.html</RecoveryUri> -->
<RecoveryUri>https://localhost:44377/Home/Error</RecoveryUri>
<DataUri>urn:com:microsoft:aad:b2c:elements:unifiedssp:1.0.0</DataUri>
<Metadata>
<Item Key="DisplayName">Signin and Signup</Item>
</Metadata>
</ContentDefinition>
当前结果:
您可能想要更新 api.error
内容定义:
<!-- This content definition is to render an error page that displays unhandled errors. -->
<ContentDefinition Id="api.error">
<LoadUri>~/tenant/default/exception.cshtml</LoadUri>
<RecoveryUri>~/common/default_page_error.html</RecoveryUri>
<DataUri>urn:com:microsoft:aad:b2c:elements:globalexception:1.1.0</DataUri>
<Metadata>
<Item Key="DisplayName">Error page</Item>
</Metadata>
</ContentDefinition>
使用custom policies时,如何指定<UserJourney>
的错误页面?根据 TFP 基础 xml 文件中的值,我原以为它会是 <RecoveryUri>
,但这是行不通的。
<ContentDefinition Id="api.signuporsignin-ext-local">
<!-- <LoadUri>~/tenant/default/unified.cshtml</LoadUri> -->
<LoadUri>https://localhost:44377/</LoadUri>
<!-- <RecoveryUri>~/common/default_page_error.html</RecoveryUri> -->
<RecoveryUri>https://localhost:44377/Home/Error</RecoveryUri>
<DataUri>urn:com:microsoft:aad:b2c:elements:unifiedssp:1.0.0</DataUri>
<Metadata>
<Item Key="DisplayName">Signin and Signup</Item>
</Metadata>
</ContentDefinition>
当前结果:
您可能想要更新 api.error
内容定义:
<!-- This content definition is to render an error page that displays unhandled errors. -->
<ContentDefinition Id="api.error">
<LoadUri>~/tenant/default/exception.cshtml</LoadUri>
<RecoveryUri>~/common/default_page_error.html</RecoveryUri>
<DataUri>urn:com:microsoft:aad:b2c:elements:globalexception:1.1.0</DataUri>
<Metadata>
<Item Key="DisplayName">Error page</Item>
</Metadata>
</ContentDefinition>