403 error when updating user fields using https://graph.microsoft.com/v1.0/me endpoint

DE 0 Reputation points
2025-11-18T06:12:59.75+00:00

Configuration is an Entra External ID tenant using a Blazor application - trying to edit the user's own profile information when logged in as their self.

Getting a 403 error when updating user fields using the https://graph.microsoft.com/v1.0/me endpoint

I have a logged in user and token looks great - I have API permissions set with the proper scopes for viewing and editing (User.Read, User.ReadWrite).

User can view their own user information, however, when the user tries to edit their own information when submitting most of the fields will not allow editing - I get a 403 error. Can basically only update the name fields but cannot find any documentation on what the issue may be.

Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-11-18T06:14:21.0066667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The 403 error you are encountering when trying to update user fields using the https://graph.microsoft.com/v1.0/me endpoint could be due to several reasons related to permissions and the specific fields you are attempting to update. Here are some potential causes and solutions:

    1. Insufficient Permissions: Even though you have the User.Read and User.ReadWrite permissions, make sure that these permissions are granted correctly in the Azure portal and that the user has consented to them. Additionally, ensure that the permissions are sufficient for the specific fields you are trying to update.
    2. Field Restrictions: Some fields in Microsoft Graph are restricted and cannot be updated by users directly. For instance, certain attributes may only be editable by administrators or may require specific permissions that are not covered by the standard User.ReadWrite permission. You can check the Microsoft Graph documentation for details on which fields are editable by users.
    3. Conditional Access Policies: If your organization has conditional access policies in place, they may restrict access to certain functionalities based on user roles or other criteria. Ensure that the logged-in user complies with any such policies.
    4. Token Scope: Verify that the access token being used includes the necessary scopes for the operations you are attempting. The token must match the permissions granted to the application.
    5. API Limitations: There may be limitations on the API that prevent certain updates. Review the Microsoft Graph API documentation for any noted limitations regarding user profile updates.

    If you continue to face issues, consider checking the Microsoft Q&A platform for similar questions or posting your specific issue there for further assistance.


    References:

    0 comments No comments

  2. Adiba Khan 1,440 Reputation points Microsoft External Staff
    2025-11-18T07:14:32.0966667+00:00

    Thank you for reaching out. The 403 error you are receiving when updating user fields through the / me endpoint is expected behavior in Microsoft Entra External ID tenants.

    Even though the access token contains User.Read and User.ReadWrite, most user profile properties cannot be updated by the user themselves.

    Root Cause:

    **1.      **The /me endpoint allows updating Only a small set of properties

    Microsoft graph permits users to update very limited fields of their own profile.

    Per official documentation:

    Microsoft graph- update user(self update limitations)

    https://learn.microsoft.com/graph/api/user-update

    Allowed user-editable fields:

    Property Editable by user?
    businessPhone No
    displayName No
    givenName No
    surname No
    mail No
    identities( External ID tenant) No
    MobilePhones Sometimes(depends on policy)
    aboutMe Yes
    usageLocation No
    otherMails No

    In external Id tenants , self update is more restricted, because identities are managed through in B2C/External Id policy framework.

    **2.      **Entra External Id users cannot modify identity attributes

    if your tenant is external ID (similar to B2C), most of the user profile data is policy managed and not modifiable through Microsoft graph.

    Official doc:

    https://learn.microsoft.com/entra/external-id/

    important notes from Microsoft:

    "end-users cannot modify identity attributes through Graph API. Attributes can only be set via user flows/custom policies."

    Why you see 403 even with correct permissions

    The following permissions

    User.Read

    User.ReadWrite

    …allows editing some profile fields- BUT NOT identity attributes, name fields, or emails.

    Therefore, when your application tries to update restricted fields such as:

    displayName

    givenName

    surname

    mail

    otherMails

    Identities

    The graph API returns:

    403 forbidden
    insufficient privileges to complete the operation
    

    Solution/Recommended Approach

    Option1 : Only update supported /me fields

    Ensure your patch request includes only fields users are allowed to update, such as:

    {
    	"aboutMe": "Updated text"
    }
    

    Microsoft graph reference:

    https://learn.microsoft.com/graph/api/user-update

    option 2- for identity fields-> Use entra framework ID user flows

    identity info must be updated through a User Flow or Custom Policy, like:

    profile editing user flow

    Sign-up/Sign-in user flow

    Docs:

    https://learn.microsoft.com/entra/external-id/customers/user-flow-overview

    Option 3- Admin updates user properties

    If these fields must be changed server-side, use an app only token with:

    User.ReadWrite.All

    This must be granted via admin consent

    https://learn.microsoft.com/graph/permissions-reference#user-permissions

    Example of what will not work (403)

    PATCH https://graph.microsoft.com/v1.0/me
    {
    	"givenName": "John",
    	"surname": "Smith"
    }
    

    These fields are restricted

    Example of what will work

    PATCH https://graph.microsoft.com/v1.0/me
    {
    	"aboutMe": "Hello, this is my bio."
    }
    

     

    Please let us know if you require any further assistance we’re happy to help. If you found this information useful, kindly mark this as "Accept Answer".


  3. can kucukgultekin 255 Reputation points
    2025-12-01T21:34:38.9+00:00

    Hey DE,

    You’re not doing anything "wrong" with your token or scopes. In an Entra External ID tenant, a lot of user profile fields are simply not meant to be updated by the user themselves via PATCH /me, even with User.ReadWrite delegated. That scope doesn’t mean "update any property on my own user object".

    In external id, things like email, phone, identities, sign-in names etc are treated as identity attributes. These are tied to sign-in, verification and security flows, so Microsoft wants them to be controlled through user flows / custom policies, not through direct Graph calls from an end user token. So Graph looks at your request and goes: "this user, in this tenant type, trying to modify this property" and for most of those identity fields it just says nope => 403.

    That’s why you see: a couple of name-related fields might go through, but the rest of your payload returns Forbidden. The scopes on the token are fine; the platform is enforcing extra rules on top of them.

    So what do you do in practice:

    On the Blazor side, restrict what you send in the PATCH /me payload to properties that are actually allowed for self-update. Don’t blindly send every field from the form, because fields like mail, identities, maybe phones etc will just keep giving you 403 and users will think the app is broken.

    For identity-ish stuff (email, phone used for login, etc), use an Entra External ID profile editing user flow. You configure that flow in the portal, and when the user hits "edit profile" in your app, you redirect them there. They change their data on Microsoft’s hosted page, the policy writes it back to the directory, and later you read it via Graph.

    If you have an admin or backend scenario where the system needs to change those fields, don’t use the user’s delegated token. Set up an app-only Graph client with client credentials, give it something like User.ReadWrite.All as application permission (with admin consent), and call PATCH /users/{id} from there. That’s the usual "admin can update users" pattern. You still have to respect the fact that some identity attributes may remain policy-driven, but at least you’re not limited to the self-update rules.

    So yeah, the 403 is basically Graph telling you "this particular property cannot be changed by this kind of user in this tenant", not "your scopes are wrong". Adjusting your UI to only allow Graph updates for the allowed fields, and using profile edit flows for the rest, is the clean way out here.

    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.