Custom Error message localization when using a claims tranformation multiple times

Matthew Bramfeld 6 Reputation points
2022-08-24T19:31:03.227+00:00

My custom policy uses two validations profiles that both use AssertBooleanClaimIsEqualToValue claims transformations. I can set an error message with metadata on UserMessageIfClaimsTransformationBooleanValueIsNotEqual, but doing so limits my ability to localize for multiple languages, as the localization file overrides the inline message. Is there a way in the Localization file to set error messages by ReferenceId to the ClaimsTransformation?

Microsoft Security Microsoft Entra Microsoft Entra External ID
{count} vote

1 answer

Sort by: Most helpful
  1. Shweta Mathur 30,296 Reputation points Microsoft Employee Moderator
    2022-08-29T07:01:20.643+00:00

    Hi @Matthew Bramfeld ,

    Thanks for reaching out and apologies for delay in response.

    I understand you are looking to set error messages with reference to ClaimsTransformation when two claims are not equal and error message need to set.

    LocalizedString doesn't allow to set any ReferenceId to the claims Transformation. Although you can localize the claims transformation error messages based on the IDs which in this case is UserMessageIfClaimsTransformationBooleanValueIsNotEqual for different Localized resources in various languages as mentioned below:

    <LocalizedResources Id="api.localaccountsignup.en">
    <LocalizedStrings>
    <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfClaimsTransformationBooleanValueIsNotEqual">Your email address hasn't been verified.</LocalizedString>
    </LocalizedStrings>
    </LocalizedResources>

    <LocalizedResources Id="api.signuporsignin.es">
    <LocalizedStrings>
    <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfClaimsTransformationBooleanValueIsNotEqual">Su dirección de correo electrónico no ha sido verificada</LocalizedString>
    </LocalizedStrings>
    </LocalizedResources>

    Reference: https://learn.microsoft.com/en-us/azure/active-directory-b2c/localization-string-ids#claims-transformations-error-messages

    Hope this will help.

    Thanks,
    Shweta

    ---------------------

    Please remember to "Accept Answer" if answer helped you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.