Azure B2C Rest API错误仍在创建帐户

Azure B2C Rest API错误仍在创建帐户,azure,azure-active-directory,azure-ad-b2c,azure-ad-b2c-custom-policy,azure-rest-api,Azure,Azure Active Directory,Azure Ad B2c,Azure Ad B2c Custom Policy,Azure Rest Api,我已经为Azure B2C创建了一个REST API,以在帐户创建流程中返回声明或错误 在我的自定义策略中,我连接了API并调用它 但是,如果API返回400或409,则仍会创建帐户,但在创建页面上会向用户显示错误消息。尽管出现错误,用户的帐户仍会被创建 然后,用户修复错误并再次单击“创建”,但无法创建帐户,因为该帐户已创建 我已按照这里的说明: 我的声明提供程序如下所示,REST API中的声明称为VerifiedDateOfBirth: <ClaimsProvider>

我已经为Azure B2C创建了一个REST API,以在帐户创建流程中返回声明或错误

在我的自定义策略中,我连接了API并调用它

但是,如果API返回400或409,则仍会创建帐户,但在创建页面上会向用户显示错误消息。尽管出现错误,用户的帐户仍会被创建

然后,用户修复错误并再次单击“创建”,但无法创建帐户,因为该帐户已创建

我已按照这里的说明:

我的声明提供程序如下所示,REST API中的声明称为VerifiedDateOfBirth

<ClaimsProvider>
            <DisplayName>REST API</DisplayName>
            <TechnicalProfiles>
                <TechnicalProfile Id="REST-Validation">
                    <DisplayName>Check date of birth</DisplayName>
                    <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.RestfulProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
                    <Metadata>
                        <!-- Set the ServiceUrl with your own REST API endpoint -->
                        <Item Key="ServiceUrl">{REST URL}}</Item>
                        <Item Key="SendClaimsIn">Body</Item>
                        <!-- Set AuthenticationType to Basic or ClientCertificate in production environments -->
                        <Item Key="AuthenticationType">None</Item>
                        <!-- REMOVE the following line in production environments -->
                        <Item Key="AllowInsecureAuthInProduction">true</Item>
                    </Metadata>
                    <InputClaims>
                        <!-- Claims sent to your REST API -->
                        <InputClaim ClaimTypeReferenceId="dateOfBirth" />
                    </InputClaims>
                    <OutputClaims>
                        <!-- Claims parsed from your REST API -->
                        <OutputClaim ClaimTypeReferenceId="VerifiedDateOfBirth" />                       
                    </OutputClaims>
                    <UseTechnicalProfileForSessionManagement ReferenceId="SM-Noop" />
                </TechnicalProfile>
            </TechnicalProfiles>
        </ClaimsProvider>

RESTAPI
核对出生日期
{REST URL}}
身体
没有一个
真的
以及技术简介:

    <TechnicalProfile Id="LocalAccountSignUpWithLogonEmail">
                    <DisplayName>Email signup</DisplayName>
                    <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
                    <Metadata>
                        <Item Key="IpAddressClaimReferenceId">IpAddress</Item>
                        <Item Key="ContentDefinitionReferenceId">api.localaccountsignup</Item>
                        <Item Key="language.button_continue">Create</Item>
                    </Metadata>
                    <CryptographicKeys>
                        <Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
                    </CryptographicKeys>
                    <InputClaims>
                        <InputClaim ClaimTypeReferenceId="email" />
                    </InputClaims>
                    <OutputClaims>
                        <OutputClaim ClaimTypeReferenceId="objectId" />
                        <OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="Verified.Email" Required="true" />
                        <OutputClaim ClaimTypeReferenceId="newPassword" Required="true" />
                        <OutputClaim ClaimTypeReferenceId="reenterPassword" Required="true" />
                        <OutputClaim ClaimTypeReferenceId="executed-SelfAsserted-Input" DefaultValue="true" />
                        <OutputClaim ClaimTypeReferenceId="authenticationSource" />
                        <OutputClaim ClaimTypeReferenceId="newUser" />
                        <!-- Optional claims, to be collected from the user -->
                        <OutputClaim ClaimTypeReferenceId="displayName" />
                        <OutputClaim ClaimTypeReferenceId="givenName" />
                        <OutputClaim ClaimTypeReferenceId="surName" />
                        <OutputClaim ClaimTypeReferenceId="dateOfBirth" Required="true" />
                        <OutputClaim ClaimTypeReferenceId="VerifiedDateOfBirth" Required="true" />
                    </OutputClaims>
                    <ValidationTechnicalProfiles>
                        <ValidationTechnicalProfile ReferenceId="AAD-UserWriteUsingLogonEmail" />
                        <ValidationTechnicalProfile ReferenceId="REST-Validation" />
                    </ValidationTechnicalProfiles>
                    <UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD" />
                </TechnicalProfile>

电子邮件注册
IP地址
api.localaccountsignup
创造
发生错误时,我在“创建”页面上看到以下错误:


是否需要添加一些其他配置?

验证配置文件的顺序在您的
LocalAccountSignUpWithLogonEmail
技术配置文件中很重要。看起来第一次进行的验证是写入用户帐户

请尝试以下方法: