【问题标题】:Azure AD B2C string format claimAzure AD B2C 字符串格式声明
【发布时间】:2023-03-18 08:54:01
【问题描述】:

我想用一次性密码发送短信,但要求是 in 必须是句子: "这是您的一次性代码123456,请确认您的帐号"。

代码生成:

 <TechnicalProfile Id="GenerateOtpSms">
      <DisplayName>OTP</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="CodeExpirationInSeconds">1200</Item>
        <Item Key="CodeLength">6</Item>
        <Item Key="CharacterSet">0-9</Item>
        <Item Key="ReuseSameCode">false</Item>
        <Item Key="MaxNumAttempts">5</Item>
        <Item Key="NumCodeGenerationAttempts">5</Item>
      </Metadata>
      <InputClaims>
        <InputClaim ClaimTypeReferenceId="signInNames.phoneNumber" PartnerClaimType="identifier" />
      </InputClaims>
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="otpSms" PartnerClaimType="otpSmsGenerated" />
      </OutputClaims>

我试过了:

  <ClaimsTransformation Id="CreateMessageTransformation" TransformationMethod="FormatStringClaim">
    <InputClaims>
      <InputClaim ClaimTypeReferenceId="otpSms" TransformationClaimType="inputClaim" />
    </InputClaims>
    <InputParameters>
      <InputParameter Id="stringFormat" DataType="string" Value="Use that code "{0} to..." />
    </InputParameters>
    <OutputClaims>
      <OutputClaim ClaimTypeReferenceId="text" TransformationClaimType="outputClaim" />
    </OutputClaims>

和带有 FormatStringMultipleClaims 的那个,但我不断收到“无法验证所提供的信息。”。我添加了

    标签: azure-ad-b2c azure-ad-b2c-custom-policy


    【解决方案1】:

    我相信你所寻找的都是可能的。

    有几件事可能有助于解决这个问题:

    • 基于MSDN documentation,我认为PartnerClaimType 用于GenerateOtpSms Technical Profile 上的输出应该是otpGenerated,而不是otpSmsGenerated
    • 您能分享otpSmstext 的声明定义吗?
    • 您在流程/旅程中的哪个位置“执行”索赔转换?

    【讨论】:

    • 唯一的问题是“PartnerClaimType”,当我将其更改为“GenerateOtp”时,我能够接收到带有生成代码的短信。谢谢你:)
    • @Wall34 - 为了其他可能有同样问题的人,您能否澄清您的最后评论。我相信你的意思是otpGenerated 而不是GenerateOtp
    • 正确,PartnerClaimType="otpGenerated",其他名称无关。我在姓名中添加了“短信”,因为我正在运行电子邮件和短信验证。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多