I have added a custom Organization
field as a User Attribute in my Azure Active Directory B2C tenant, like so:
I am using the Microsoft Graph .NET Client Library to manage users in Azure Active Directory B2C and would like to use something similar to the following code to set the user's custom Organization
field and the user's built-in Email Addresses
field.
await graphClient.Users[user.Id].Request().UpdateAsync(new User()
{
Email Addresses = new StringCollection("myemail@mydomain.com")
Organization = "Microsoft"
});
Two questions:
- How do I set a Built-in field, like the
Email Addresses
? - How do I set a Custom field, like
Organization
?
This documentation shows how to create a custom attribute but does not tell how to access or use that attribute using the Graph Client.
This documentation shows how to create custom attributes and edit the Relying Party (RP) file.
Is there an easier way? And what is the graphClient
code to then get/set these custom user attributes?