0

我已经使用本地化设置了 OTP 用户消息。UserMessageIfInvalidCode正在工作但UserMessageIfVerificationFailedRetryAllowed不工作。我将重试计数设置为 5,但是只有UserMessageIfInvalidCode当消息无效时才会显示。不知道我错过了什么:

<ContentDefinitions>
  <ContentDefinition Id="content.phone.verify">
    <LoadUri>~/tenant/templates/AzureBlue/selfAsserted.cshtml</LoadUri>
    <RecoveryUri>~/common/default_page_error.html</RecoveryUri>
    <DataUri>urn:com:microsoft:aad:b2c:elements:contract:selfasserted:2.1.4</DataUri>
    <LocalizedResourcesReferences MergeBehavior="Prepend">
      <LocalizedResourcesReference Language="en" LocalizedResourcesReferenceId="content.phone.verify.en" />
    </LocalizedResourcesReferences>
  </ContentDefinition>
</ContentDefinitions>

<Localization Enabled="true">
  <SupportedLanguages DefaultLanguage="en" MergeBehavior="ReplaceAll">
    <SupportedLanguage>en</SupportedLanguage>
  </SupportedLanguages>
  <LocalizedResources Id="content.phone.verify.en">
    <LocalizedStrings>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfSessionDoesNotExist">Your code has expired, please request a new one.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfMaxRetryAttempted">You have exceeded the number of retries allowed.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfMaxNumberOfCodeGenerated">You have exceeded the number of code generation attempts allowed.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfInvalidCode">TEST You have entered the wrong code.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfSessionConflict">Cannot verify the code, please try again later.</LocalizedString>
      <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfVerificationFailedRetryAllowed">That code is incorrect, please try again.</LocalizedString>
    </LocalizedStrings>
  </LocalizedResources>
</Localization>

<TechnicalProfile Id="SelfAsserted-mfa">
  <DisplayName>MFA</DisplayName>
  <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
  <Metadata>
    <Item Key="ContentDefinitionReferenceId">content.phone.verify</Item>
    <Item Key="setting.inputVerificationDelayTimeInMilliseconds">500</Item>
  </Metadata>
  <IncludeInSso>false</IncludeInSso>
  <InputClaimsTransformations>
    <InputClaimsTransformation ReferenceId="CreatePhoneNumberList" />
  </InputClaimsTransformations>
  <InputClaims>
    <InputClaim ClaimTypeReferenceId="phoneNumberString" />
  </InputClaims>
  <DisplayClaims>
    <DisplayClaim ClaimTypeReferenceId="phoneNumberString" />
    <DisplayClaim DisplayControlReferenceId="phoneVerificationControl" />
  </DisplayClaims>
</TechnicalProfile>

<TechnicalProfile Id="MFA-GenerateCode">
  <DisplayName>Generate Code</DisplayName>
  <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.OneTimePasswordProtocolProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
  <Metadata>
    <Item Key="Operation">GenerateCode</Item>
    <Item Key="NumRetryAttempts">5</Item>
    <Item Key="ReuseSameCode">true</Item>
  </Metadata>
  <InputClaims>
    <InputClaim ClaimTypeReferenceId="userPhoneNumber" PartnerClaimType="identifier" />
  </InputClaims>
  <OutputClaims>
    <OutputClaim ClaimTypeReferenceId="verificationCode" PartnerClaimType="otpGenerated" />
  </OutputClaims>
</TechnicalProfile>

4

0 回答 0