How to show additional fields in the output json of /.auth/me endpoint in azure web app.

Amaaz Arshad 40 Reputation points
2025-01-14T20:53:23.49+00:00

I want to add the "Company Name" field (as shown in the image) to the output of /.auth/me endpoint. How can I achieve this?

User's image

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,261 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,899 questions
{count} votes

Accepted answer
  1. Raja Pothuraju 11,170 Reputation points Microsoft Vendor
    2025-01-15T08:46:26.79+00:00

    Hello @Amaaz Arshad,

    Thank you for posting your query on Microsoft Q&A.

    Based on your description, it seems you are looking to include the Company Name claim field in the /.auth/me endpoint within the token.

    To add this claim to the token, you need to configure optional claims for the registered application in Entra ID. Please follow the steps below to pass the claim in the /.auth/me endpoint:

    1. Navigate to Microsoft Entra ID > Enterprise Applications and search for the application linked to your web app in Azure App Service.
    2. Open the application, then go to the Single Sign-On blade.
    3. Click Edit under the Attributes & Claims section.
    4. Click Add New Claim and, under Source Attribute, select User.CompanyName, then click Save.

    User's image

    This configuration will allow the Company Name attribute to be included in the token when a logged-in user requests it.

    I hope this information is helpful. Please feel free to reach out if you have any further questions.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Thanks,
    Raja Pothuraju.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.