Custom Attributes Mapping for Microsoft Entra
This describes how to add user custom attributes to Microsoft Entra ID. There are 2 ways this can be completed:
Pre-requisites
Make sure you have the following privileges:
- Microsoft Entra Admin Center login requires you to be at least a User Administrator | Microsoft.
- Graph API consent permission.
- Microsoft Azure Portal login.
Option 1 - Using Microsoft Entra Admin Center
- Sign in to the Microsoft Entra Admin Center, https://entra.microsoft.com/.
- From the menu, navigate to Identity > External Identities > Overview.
- From the sub-menu, select Custom user attributes and the available user attributes are listed.
You can add the custom attribute here.
- Click the +Add button and the Add an attribute form displays.
- In the Name field, enter the name for the custom attribute.
- From the Data Type drop-down, select a data type, such as String, Boolean, or Integer.
- In the the Description field, enter a short description of the custom attribute. This is for internal use and isn't visible to the user.
- Click the Create button.
Option 2 - Using Graph API
You can add an attribute and update custom attribute to the user from Graph API.
- Navigate to Graph Explorer | Microsoft Graph APIs, https://developer.microsoft.com/en-us/graph/graph-explorer
- Click the API Explorer to displays the available resources.
- From the Resources Available navigate to applications>{application-id}>extensionProperties
- Click POST.
The {applicaition-id} used in the post request URL can be fetched:
- Navigate to the Azure Portal.
- Select the Microsoft Entra ID resource.
- From the left menu, navigate to Manage > App registrations.
- Select the SCIM Application.
- From the menu, select Overview.
- Then in the Overview screen for Essentials copy the Object ID.
- Update the custom attribute value for the user.
API Request Body
{ "name": "{name of attribute}", "dataType": "{data type of attribute}", "targetObjects": [ "User" ] }
The custom attribute created above is now updated for a particular user.
- Navigate to the Sample Queries tab.
- Select Users > PATCH (update user) API.
- Update the value by running the above API.
The {id} used in the patch request URL can fetched:
- Navigate to the Azure Portal.
- Select Microsoft Entra ID resource.
- From the menu, navigate to Manage > Users.
- Select the User.
- In the Overview copy the Object ID / User principal name.
API Request Body
{ "{name of attribute}": "{value}" }
Map Custom Attributes with SCIM API
- Navigate to the Azure Portal.
- Go to a Microsoft Entra ID resource.
- From the menu, navigate to Manage > Enterprise Applications.
- Select the SCIM Application.
- From the menu, navigate to Manage > Provisioning.
- Go to Manage Provisioning > Edit Attribute Mapping.
- Select Mappings.
- Click Provision Microsoft Entra ID Users.
- Check the Show advanced options check box.
- Click the Edit attribute list for customappsso.
- Add target attribute and save.
S. No. | Attribute Name for Microsoft Entra Id Target | Data Type |
---|---|---|
1 |
urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:manager |
Reference |
2 |
urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:employeeNumber |
string |
3 |
urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:organization |
string |
4 |
urn:ietf:params:scim:schemas:extension:customextensionname:2.0:User:usageLocation |
string |
6 |
urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:costCenter |
string |
7 |
urn:ietf:params:scim:schemas:extension:customextensionname:2.0:User:group |
string |
8 |
urn:ietf:params:scim:schemas:extension:customextensionname:2.0:User:floor |
string |
10 |
urn:ietf:params:scim:schemas:extension:customextensionname:2.0:User:phoneExtension |
string |
11 |
urn:ietf:params:scim:schemas:extension:customextensionname:2.0:User:workMode |
string |
12 |
urn:ietf:params:scim:schemas:extension:customextensionname:2.0:User:image |
string |
For example
- After the attributes are created, click the Add New Mapping, to map the custom attribute.
- From the Source attribute drop-down, select the source which is the attribute name added from Microsoft Entra Admin Center/Graph API.
- From the Target attribute drop-down, select target attributes that are set in the above step (Map Custom Attributes with SCIM API).
- Click the OK button.
- Click the Save button.
Test Custom attribute mapping
- Navigate to the Azure Portal.
- Go to a Microsoft Entra ID resource.
- From the menu, navigate to Manage > Enterprise Applications.
- Select the SCIM Application.
- From the menu, navigate to Manage > Provisioning.
- From the menu, select Provision on Demand.
- In the Select a user or group field, search for the user and the select the user name.
- Click the Provision button.