0

I want to send sms with one time password but the requirement is that in must be in sentence: "This is your one time code 123456, please confirm your account".

code generation:

 <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>

I've tried this:

  <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>

and the one with FormatStringMultipleClaims, but i keep getting "Unable to validate the information provided.". I've added <Item Key="ApplicationObjectId> and but it's not working.

Without CreateMessageTransformation, I am able to generate password, and send sms, but without the generated code.

Is there any other way to achieve "This is your one time code {otpSms}, please confirm your account"?

otpSms is type of string.

Wall34
  • 11
  • 3

1 Answers1

1

I believe that what you are looking for is possible.

A couple of things that might shed some light on this issue:

  • Based on the MSDN documentation, I thought the PartnerClaimType for the output on the GenerateOtpSms Technical Profile was supposed to be otpGenerated, not otpSmsGenerated
  • Can you share the claims definitions for otpSms and text?
  • Where in your flow/journey are you "executing" the Claims transformation?
Brad C.
  • 564
  • 3
  • 5
  • The only issue was is "PartnerClaimType", when I changed it to "GenerateOtp" I was able to receive sms message with generated code. Thank you :) – Wall34 Feb 14 '21 at 12:36
  • @Wall34 - For the sake of others that might have the same problem, could you clarify your last comment. I believe you meant `otpGenerated` and not `GenerateOtp`. – Brad C. Feb 19 '21 at 16:07
  • 1
    Correct, PartnerClaimType="otpGenerated", the other names are irrelevant. I have added 'sms' to names because I'm running email and sms verification. – Wall34 Feb 23 '21 at 14:08