I've been successfully using curl to fetch and update the postal code of a user in my Azure Active Directory Tenant with commands like this:
curl -X GET https://graph.microsoft.com/v1.0/users/<userGuid>?\$select=displayName,givenName,postalCode,xyz -H "Authorization: Bearer $AAD_BEARER_TOKEN"
This displays the displayName, givenName and postalCode but ignores the custom string attribute xyz that I created using the web browser UI at portal.azure.com.
Note that since I'm using cygwin bash on windows, I have to escape my dollars and ampersands.
How can I use curl to populate this new field I created called xyz?
I've tried using open extensions but the samples don't work (possibly because they don't include a bearer token and they don't specify a specific user). Can I expect to see the custom attribute "xyz" I created with the Web UI on portal.azure.com show up?
curl -X GET https://graph.microsoft.com/v1.0/me?\$select=id,displayName,mail,mobilePhone\&\$expand=extensions
This gives me "InvalidAuthenticationToken". When I add a bearer token I get
Resource '1acbf9cc-d931-4ff3-bafe-218693fba30e' does not exist or one of its queried reference-property objects are not present.
Tue March 02 2021 evening update:
Shame on me! I forgot the most important question: how do I post/patch a new value so I have something to fetch (GET)? I cannot tell if the GET is working because the value is empty.
Wed March 03 2021 morning update: I finally found the docs on custom attributes and it says I need to modify my custom policy in TrustFrameworkExtensions.xml. Stanley: did you do this? I'm not clear on the XML for InputClaims, PersistClaims & OutputClaims. Do I need to edit this XML and upload it?




