MS Graph extensionProperties

Patrice Côté 186 Reputation points
2021-12-03T20:51:55.483+00:00

I have added some custom properties as extendedProperties in MS Graph following the Microsoft documentation here.

I first created it with a POST query :

POST "https://graph.microsoft.com/v1.0/applications/{b2c-extensions-app_objectId}/extensionProperties"
{
"name": "requiresMigration",
"dataType": "Boolean",
"targetObjects": ["User"]
}

I then updated a user (PATCH query) to add it like so :

PATCH "https://graph.microsoft.com/v1.0/users/{my-user-id}
{
"extension_{b2c-extensions-app_applicationId}_requiresMigration": true
}"

In AAD B2C, my custom policy is able to retreive those claims and send them back in the identity token, no problem. But in MS Graph, there is no way I can see it? I tried like defined in the documentation (https://graph.microsoft.com/v1.0/users/{my-user-id})/extensionProperties) but it didn't work. Can anyone tell me how can I retreive the users WITH these custom extension properties please?

**NOTE that we didn't use open or schema extensions for this, we used extensionProperties. This was in a migration scenario that I followed.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,663 questions
Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,654 questions
0 comments No comments
{count} votes

Accepted answer
  1. AmanpreetSingh-MSFT 56,311 Reputation points
    2021-12-06T05:11:27.21+00:00

    Hi @Patrice Côté • Thank you for reaching out.

    If you use the GET call https://graph.microsoft.com/v1.0/users/{user-id}, it will only return a subset of the properties for the given user, which does not include the extension properties. In order to get the extension properties, you need to specify the extension attribute name using the $select parameter, as mentioned below:

    GET https://graph.microsoft.com/v1.0/users/{user-id}?$select=extension_b2c-extensions-appId_requiresMigration  
    

    You may also consider using the beta endpoint if you do not want to use the $select parameter.

    GET https://graph.microsoft.com/beta/users/{user-id}  
    

    This call will return all the attributes of the given user including the extension attributes.

    -----------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful