Azure AD B2C字符串格式声明



我想发送短信与一次密码,但要求是,在必须在句子:这是您的一次性代码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>

和一个formatstringmultiecclaims,但我一直得到"无法验证所提供的信息"。我已经添加了但是它不工作。

没有CreateMessageTransformation,我可以生成密码,发送短信,但没有生成的代码。

是否有其他方式实现"这是您的一次性代码{otpms},请确认您的账户">

otpms是字符串类型。

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

有几件事可能会对这个问题有所启发:

  • 根据MSDN文档,我认为GenerateOtpSms技术配置文件上输出的PartnerClaimType应该是otpGenerated,而不是otpSmsGenerated
  • 能分享otpSmstext的索赔定义吗?
  • 在你的心流/旅程中,你在哪里"执行"?索赔转换?

最新更新