Warm tip: This article is reproduced from stackoverflow.com, please click
azure azure-active-directory azure-ad-b2c

Azure AD B2C Custom SignIn Policy Displays SignUpSignIn

发布于 2020-03-27 10:26:22

I have a custom SignIn policy, because I need to fetch something from an application database (via REST API) during the sign in process.

So I have this user journey

<UserJourney Id="SignIn">
      <OrchestrationSteps>

        <OrchestrationStep Order="1" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.localaccountsignin">
          <ClaimsProviderSelections>
            <ClaimsProviderSelection ValidationClaimsExchangeId="LocalAccountSigninEmailExchange" />
          </ClaimsProviderSelections>
          <ClaimsExchanges>
            <ClaimsExchange Id="LocalAccountSigninEmailExchange" TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-Email" />
          </ClaimsExchanges>
        </OrchestrationStep>

        <OrchestrationStep Order="2" Type="ClaimsExchange">
          <ClaimsExchanges>
            <ClaimsExchange Id="AADUserReadWithObjectId" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" />
          </ClaimsExchanges>
        </OrchestrationStep>

        <OrchestrationStep Order="3" Type="ClaimsExchange">
          <ClaimsExchanges>
            <ClaimsExchange Id="GetCustomDbObj" TechnicalProfileReferenceId="GetCustomDbObj" />
          </ClaimsExchanges>
        </OrchestrationStep>

        <OrchestrationStep Order="4" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" />

      </OrchestrationSteps>
      <ClientDefinition ReferenceId="DefaultWeb" />
    </UserJourney>

You can see that in step #3, I have a reference to a custom technical profile that fetches some data from a custom REST API.

In the first step, I display (supposedly) the sign in page, it references api.localaccountsignin

<ContentDefinition Id="api.localaccountsignin">
        <LoadUri>https://mytenant.b2clogin.com/static/tenant/default/signin.cshtml</LoadUri>
        <RecoveryUri>https://mytenant.b2clogin.com/static/tenant/default/signin.cshtml</RecoveryUri>
        <DataUri>urn:com:microsoft:aad:b2c:elements:contract:unifiedssp:1.0.0</DataUri>
        <Metadata>
          <Item Key="TemplateId">azureBlue</Item>
        </Metadata>
      </ContentDefinition>

The problem is that when I use the policy, I see a page that resembles the signup+signin unified policy

enter image description here

Instead of just the sign in policy, which is what I desire.

I suspect that it has something to do with

<OrchestrationStep Order="1" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.localaccountsignin">

More specifically, CombinedSignInAndSignUp But I don't know what to put instead. I tried using ClaimsExchange but it didn't work.

Is there a solution?

Questioner
user10962730
Viewed
241
nzpcmad 2019-07-04 03:11

As per this:

You can achieve this by setting SignUp to “False”.

<Item Key=”setting.showSignupLink”>False</Item>