元素未显示在 UI 中:Azure AD B2C 自定义策略

问题描述 投票:0回答:0

我正在尝试自定义登录页面。 我的问题是以下问题。在登录页面中,我需要一个下拉菜单,以便用户可以选择首选的 MFA 方法。 但是,如您所见,没有下拉菜单,当用户输入用户名和密码时,它会报错,因为缺少身份验证方法(下拉菜单)。 关于基本政策:

    <ClaimType Id="selectedAuthenticationMethod">
        <DisplayName>Authentication Method</DisplayName>
        <DataType>string</DataType>
        <UserInputType>DropdownSingleSelect</UserInputType>
        <Restriction>
            <Enumeration Text="App"
                         Value="app"
                         SelectByDefault="true" />
            <Enumeration Text="Phone"
                         Value="phone" />
            <Enumeration Text="Email"
                         Value="email" />
        </Restriction>
    </ClaimType>
        <TechnicalProfile Id="SelfAsserted-LocalAccountSignin-Email">
            <DisplayName>Local Account Signin</DisplayName>
            <Protocol Name="Proprietary"
                      Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
            <Metadata>
                <Item Key="SignUpTarget">SignUpWithLogonEmailExchange</Item>
                <Item Key="setting.operatingMode">Email</Item>
                <Item Key="setting.showSignupLink">false</Item>
                <!-- Item Key="ContentDefinitionReferenceId">api.localaccountsignin</Item -->
                <Item Key="IncludeClaimResolvingInClaimsHandling">true</Item>
            </Metadata>
            <IncludeInSso>false</IncludeInSso>
            <InputClaims>
                <InputClaim ClaimTypeReferenceId="signInName"
                            DefaultValue="{OIDC:LoginHint}"
                            AlwaysUseDefaultValue="true" />
            </InputClaims>
            <OutputClaims>
                <OutputClaim ClaimTypeReferenceId="signInName"
                             Required="true" />
                <OutputClaim ClaimTypeReferenceId="password"
                             Required="true" />
                <OutputClaim ClaimTypeReferenceId="objectId" />
                <OutputClaim ClaimTypeReferenceId="authenticationSource" />
                <OutputClaim ClaimTypeReferenceId="selectedAuthenticationMethod" Required="true"/>
            </OutputClaims>
            <ValidationTechnicalProfiles>
                <ValidationTechnicalProfile ReferenceId="login-NonInteractive" />
            </ValidationTechnicalProfiles>
            <UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD" />
        </TechnicalProfile>

子旅程:

 <SubJourney Id="SignInBase"
                    Type="Call">
            <OrchestrationSteps>
                <OrchestrationStep Order="1"
                                   Type="CombinedSignInAndSignUp"
                                   ContentDefinitionReferenceId="api.signuporsignin">
                    <ClaimsProviderSelections>
                        <ClaimsProviderSelection ValidationClaimsExchangeId="LocalAccountSigninEmailExchange" />
                    </ClaimsProviderSelections>
                    <ClaimsExchanges>
                        <ClaimsExchange Id="LocalAccountSigninEmailExchange"
                                        TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-Email" />
                    </ClaimsExchanges>
                </OrchestrationStep>
                <OrchestrationStep Order="2"
                                   Type="ClaimsExchange">
                    <ClaimsExchanges>
                        <ClaimsExchange Id="AADUserReadWithEmailAddressBefore"
                                        TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" />
                    </ClaimsExchanges>
                </OrchestrationStep>

本地化:

 <LocalizedResources Id="api.signuporsignin.en">
                <LocalizedCollections>
                    <LocalizedCollection ElementType="ClaimType"
                                         ElementId="selectedAuthenticationMethod"
                                         TargetCollection="Restriction">
                        <Item Text="App"
                              Value="app"
                              SelectByDefault="true" />
                        <Item Text="Phone"
                              Value="phone" />
                        <Item Text="Email"
                              Value="email" />
                    </LocalizedCollection>
                </LocalizedCollections>
                <LocalizedStrings>

有什么帮助吗?

customization claims-based-identity azure-ad-b2c-custom-policy claims claims-authentication
© www.soinside.com 2019 - 2024. All rights reserved.