0

我在旅途中使用 api.signuporsignin 并自定义了登录页面,但是当我点击注册链接时,它会转到 MS 默认注册页面而不是自定义注册。我看到这个链接转到

https://tenant.b2clogin.com/tenant.onmicrosoft.com/B2C_1A_signup_signin/api/CombinedSigninAndSignup/unified?local=signup ..。

有没有办法使用 api.signuporsignin 自定义注册页面?

这是我的旅程

<UserJourney Id="SignUpWithEmailOrSignInWithUsernameOrEmail">
            <OrchestrationSteps>
                <OrchestrationStep Order="1" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.signuporsignin">
                    <ClaimsProviderSelections>
                        <ClaimsProviderSelection ValidationClaimsExchangeId="LocalAccountSigninUsernameExchange" />
                    </ClaimsProviderSelections>
                    <ClaimsExchanges>
                        <ClaimsExchange Id="LocalAccountSigninUsernameExchange" TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-Username" />
                    </ClaimsExchanges>
                </OrchestrationStep>
                <OrchestrationStep Order="2" Type="ClaimsExchange">
                <Preconditions>
                    <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
                    <Value>objectId</Value>
                    <Action>SkipThisOrchestrationStep</Action>
                    </Precondition>
                </Preconditions>
                <ClaimsExchanges>
                    <ClaimsExchange Id="SignUpWithLogonEmailExchange" TechnicalProfileReferenceId="LocalAccountSignUpWithLogonEmail" />
                </ClaimsExchanges>
            </OrchestrationStep>

...

<TechnicalProfile Id="SelfAsserted-LocalAccountSignin-Username">
                <DisplayName>Local Account Signin with Username</DisplayName>
                <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
                <Metadata>
                    <Item Key="SignUpTarget">SignUpWithLogonUsernameExchange</Item>
                    <Item Key="setting.operatingMode">Username</Item>
                    <Item Key="ContentDefinitionReferenceId">api.selfasserted.test</Item>
                </Metadata>

谢谢

编辑 1:添加内容定义。我可以自定义登录页面但不能注册。当您点击立即注册链接时,会出现默认的 MS 页面

<ContentDefinitions>
        <ContentDefinition Id="api.signuporsignin">
            <LoadUri>https://something.blob.core.windows.net/mycontainer/custom-ui.html</LoadUri>
            <RecoveryUri>~/common/default_page_error.html</RecoveryUri>
            <DataUri>urn:com:microsoft:aad:b2c:elements:unifiedssp:1.0.0</DataUri>
            <Metadata>
                <Item Key="DisplayName">Signin and Signup</Item>
            </Metadata>
        </ContentDefinition>
        <ContentDefinition Id="api.selfasserted.test">
            <LoadUri>https://something.blob.core.windows.net/mycontainer/custom-signup.html</LoadUri>
            <RecoveryUri>~/common/default_page_error.html</RecoveryUri>
        <DataUri>urn:com:microsoft:aad:b2c:elements:selfasserted:1.1.0</DataUri>
            <Metadata>
            <Item Key="DisplayName">Collect information from user page</Item>
            </Metadata>
      </ContentDefinition>
    </ContentDefinitions>
4

2 回答 2

1

查看您的信任框架基础定义和用户旅程的(未发布的)其余部分。

注册或登录页面仅提供指向“注册”页面的链接——其工作原理基本上是跳过编排步骤。注册或登录页面之后的第二个编排步骤通常会测试是否存在用户对象 ID 声明(例如 - 用户是否实际登录),然后运行具有单独内容定义的注册步骤,如果用户正在尝试注册而不是登录...

例如,在 MS 提供的基本策略中:

<UserJourney Id="SignUpOrSignIn">
      <OrchestrationSteps>
      
        <!-- Present the sign up or sign in page, with `api.signuporsignin` -->
        <OrchestrationStep Order="1" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.signuporsignin">
          <ClaimsProviderSelections>
            <ClaimsProviderSelection ValidationClaimsExchangeId="LocalAccountSigninEmailExchange" />
          </ClaimsProviderSelections>
          <ClaimsExchanges>
            <ClaimsExchange Id="LocalAccountSigninEmailExchange" TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-Email" />
          </ClaimsExchanges>
        </OrchestrationStep>

        <!-- 
            If the previous step did not generate a user object ID (IE - 
            sign the user in), show the sign up page.
 
            The `LocalAccountSignUpWithLogonEmail` technical profile 
            should use a diffrent content definion because it's a self-assert
            profile - in this case `api.localaccountsignup` - You'll need to
            customize this content definition too.
         -->
        <OrchestrationStep Order="2" Type="ClaimsExchange">
          <Preconditions>
            <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
              <Value>objectId</Value>
              <Action>SkipThisOrchestrationStep</Action>
            </Precondition>
          </Preconditions>
          <ClaimsExchanges>
            <ClaimsExchange Id="SignUpWithLogonEmailExchange" TechnicalProfileReferenceId="LocalAccountSignUpWithLogonEmail" />
          </ClaimsExchanges>
        </OrchestrationStep>
...
于 2020-12-30T01:40:58.677 回答
0

正如@Allen Wu 建议的那样,在TrustFrameworkExtensions.xml中搜索“api.signuporsignin”,检查Loaduri是否与您在Azure AD protal->storge account ->container 中设置的 url 一致。

  <ContentDefinition Id="api.signuporsignin">
    <LoadUri>https://storage1.blob.core.windows.net/root/custom-ui.html</LoadUri>
    <RecoveryUri>~/common/default_page_error.html</RecoveryUri>
    <DataUri>urn:com:microsoft:aad:b2c:elements:unifiedssp:1.0.0</DataUri>
    <Metadata>
      <Item Key="DisplayName">Signin and Signup</Item>
    </Metadata>
    <LocalizedResourcesReferences MergeBehavior="Prepend">
      <LocalizedResourcesReference Language="en" LocalizedResourcesReferenceId="api.signuporsignin.en" />
      <LocalizedResourcesReference Language="es" LocalizedResourcesReferenceId="api.signuporsignin.es" />
    </LocalizedResourcesReferences>
  </ContentDefinition>
于 2020-12-29T07:53:12.207 回答