Azure AD claim transformation to find and replace in SAML request after sso authorization

Venkata 146 Reputation points

Hello,I need to find and replace domain in email received to a new value.

Example - If users email id is , then return value as

i tried steps below but not able get results. Any inputs is highly appreciated.

Thank you in advance.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,397 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sandeep G-MSFT 14,241 Reputation points Microsoft Employee


    Thank you for reaching out to us on Q&A platform.

    I have performed the same steps in my lab tenant, and I am able to get the expected results.

    In my lab I took an example of user account with email ""

    I transformed this claim and got the output claim as

    Below is the screenshot with my output result,

    User's image

    In above screen shot you can see that in Regex pattern I have mentioned the value as "(?'domain'^.*?)(?i)($", where "" is my input domain name.

    In my output domain I wanted to get the value as

    I configured Replacement pattern value as "{domain}".

    Now as seen in above screenshot I am getting the Test transformation result as "".

    It is working as expected. You can configure the claim values as I did and change domain names as you are expecting them in the output value.

    Let me know if you have any further questions.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.