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