No update custom atribute B2C using graph api

ADM ITG 1 Reputation point
2020-10-05T22:24:48.493+00:00

I have created custom attributes for b2c users.
My problem is that I want to edit or update these attributes using graph api, but I get the following error "One or more property values specified are invalid.".
This error does not appear when I edit attributes that are not custom.

30188-image.png

Please help.

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

2 answers

Sort by: Most helpful
  1. JamesTran-MSFT 36,906 Reputation points Microsoft Employee Moderator
    2020-10-05T22:56:06.513+00:00

    @ADM ITG
    Thank you for your post!

    I reached out to my team regarding this issue and we found that B2C does not extend the directory schema, since the schema for B2C lies within the actual policy itself. So if you declare a custom attribute i.e. "ruc", you won't be able to manage it through the GraphAPI. If you'd like to submit a feature request you can do so within our GraphAPI user voice forum.

    For more info:
    Manage Azure AD B2C user accounts with Microsoft Graph
    Update user
    Microsoft Graph operations available for Azure AD B2C

    If you have any other questions, please let me know.
    Thank you for your time and patience throughout this issue.


  2. Christopher Norris 6 Reputation points
    2022-01-09T02:43:48.563+00:00

    Hello,

    it looks like you are missing the actual extension attributes name.

    the attribute is actually named this: "extension_{appIdForExtensionApp}_ruc"

    To find your Extensin App Id, go into B2C Tenant, Click On App Registrations, and select All Applications. You will find b2c-extensions-app. Do not modify. Used by AADB2C for storing user data.

    Then, when you send a Graph Api call, make sure its a patch request

    patch: https://graph.microsoft.com/v1.0/users/{userId}

    {
    "extension_b19de2b68cc14eef8307445bf2d06ecb_ruc": "valueYouWant"
    }

    Make sure you are not using hyphens "-" in the appId.

    0 comments No comments

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.