On EntraID SAML App I need to add a custom claim with hardcoded string "YES"

Ajith Thomas 20 Reputation points
2025-11-04T17:51:11.5433333+00:00

I'm configuring a SAML application on Entra

I want to add a custom claim with a hardcoded string like

"customClaim" : "YES"

I see a blog post where user has mentioned that he has added a hardcoded claim ACCOUNTS:"dev1" as shown in the screenshot below - url :https://video2.skills-academy.com/en-us/answers/questions/251487/how-to-add-custom-user-attribute-to-use-in-azure-s

Can someone tell how to add this hardcoded claim on EntraID UI?

I tried however there isn't an option to specify hardcoded string for SAML token claims.

Thanks,

Ajith

62041-screen-shot-2021-01-29-at-114901-am.png

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

Answer accepted by question author
  1. Monalisha Jena 3,515 Reputation points Microsoft External Staff Moderator
    2025-11-05T05:59:54.3133333+00:00

    Hello Ajith Thomas,

    Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.

    I understand your confusion. You are absolutely right; there is no separate option labeled 'Hardcoded String' in the UI. The solution requires you to use the 'Source attribute' field in an unconventional way. The key is to input the desired hardcoded string without quotation marks.

    Here are the critical steps to confirm you are using the correct method:

    • Go to Microsoft Entra admin center and sign in as at least a Cloud Application Administrator.
    • Navigate to Entra ID > Enterprise applications > [Your App] > Single sign-on > User Attributes & Claims.​
    • Click Edit under User Attributes & Claims (as shown in your screenshot).
    • Click Add new claim.
    • In the Manage claim panel: Name: Enter the desired claim name (e.g., customClaim). Source: Ensure Attribute is selected (this is the default). Source attribute: Crucially, erase any default value and directly type the hardcoded string you want to use, without quotation marks. For your request, you would type: YES
      For the example in the screenshot (ACCOUNTS: "dev1"), they would have typed: "dev1" (including the quotes for the value of the claim). The surrounding quotes in the screenshot usually indicate a literal string. In the Entra ID UI, you type the literal value you want to be emitted.
    • Click Save.

    This will result in all SAML tokens having the specified claim (e.g., customClaim: YES) for every user.

    Please do refer below document for better understanding:

    https://video2.skills-academy.com/en-us/entra/identity-platform/saml-claims-customization

    NOTE: You can add a static, hardcoded claim for any SAML app in Entra ID. If the UI does not show the field, make sure you’re adding, not editing claims, and manually enter the desired value in the Source Attribute field.

    Could you please try these specific steps again and let me know if you are able to successfully enter YES into the Source attribute field.
    Happy to help!

    Regards,

    Monalisha

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Ajith Thomas 20 Reputation points
    2025-11-05T09:40:03.5733333+00:00

    That has answered my query.

    Thanks,

    Ajith

    User's image

    0 comments No comments

Your answer

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