1

I'm working on a password reset flow and I need to display a custom message returned by an API response, but I can't find a way to display this message. I've tried the following.

<ClaimType Id="userMessage">
        <DisplayName>userMessage</DisplayName>
        <DataType>string</DataType>
        <UserInputType>Paragraph</UserInputType>
    </ClaimType>
<TechnicalProfile Id="SendOtp">
          <DisplayName>Send Otp</DisplayName>
          <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.RestfulProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          <Metadata>
            <Item Key="ServiceUrl">SomeUrl</Item>
            <Item Key="AuthenticationType">ApiKeyHeader</Item>
            <Item Key="SendClaimsIn">Body</Item>
          </Metadata>
          <InputClaims>
            <InputClaim ClaimTypeReferenceId="email" />
          </InputClaims>
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="userMessage" />
          </OutputClaims>
        </TechnicalProfile>

But it doesn't show anything.

Pedro
  • 37
  • 3

1 Answers1

1

Have your API return a HTTP 409 error response code. The flow will not continue after this point, until your API responds with HTTP 200 upon the user submitting the page again.

https://learn.microsoft.com/en-us/azure/active-directory-b2c/restful-technical-profile#error-handling

You cannot display a message from the API, unless the API responds with HTTP 409 error status code.

If you want to display a message on success, then localise the message for the display control for send code:

https://learn.microsoft.com/en-us/azure/active-directory-b2c/localization-string-ids#verification-display-control-user-interface-elements

Jas Suri - MSFT
  • 10,605
  • 2
  • 10
  • 20