简体   繁体   中英

How can i add Custom Attributes to my Azure AD tenant members (Not B2C users)

I have an Azure AD tenant and I am looking for a way to include extra attributes while creating members within my organization. I have poked around the interface and can't find a way to achieve this on the Azure portal. From my findings, I can see tones of documentation and blog posts on how to achieve this using the B2C feature and graph API for external customers. However, this does not meet my requirements.

I believe this is a basic requirement that should be possible on Azure AD. Can someone please point me to the right documentation to achieve this?

Azure portal doesn't provide such a feature but we can archive this using Microsoft Graph API: Create extensionProperty .

You need to specify the targetObjects as "User".

An example (you can use any of your app registrations for {object id of the app registration} ):

Post https://graph.microsoft.com/v1.0/applications/{object id of the app registration}/extensionProperties

{"name":"customAttribute","dataType":"string","targetObjects":["User"]}

It will generate an extension property named extension_{client id of the app registration without "-"}_customAttribute .

Then you can update the extension property for a user:

Patch https://graph.microsoft.com/v1.0/users/{user id}

{"extension_{client id of the Azure AD application without "-"}_customAttribute":"value"}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM