Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
How to: Add an Azure Active Directory (AAD) custom property to the UserContext
Akumina 22.214.171.124 and later
This assumes you are using Office 365/SharePoint Online with Azure Active Directory (AAD)
When using Azure Active Directory, if you have custom properties you will often want to use these for personalizationand other purposes. This article explains how to add a custom property in Azure Active Directory (AAD) to the UserContext.
By default The Akumina framework will return a base set of properties from AAD, shown below.
In our example, we want to get 2 additional properties from AAD:
To do so, we need to add them to the call that is made to get the current user properties, by editing the Akumina.Digispace.UserContext.customProperties object.
We edit the property as we want to add fields to the call.
In our site's digitalworkplace.custom.js file (or equivalent) we add in the following:
Akumina.Digispace.UserContext.customProperties += ",extension_15a57b96db9b4c1db3446b618c8eeab6_employeetype,usagelocation";
In our example, we add in the code above to retrieve the extra properties.
We now see the usagelocation property shown in the Akumina.Digispace.UserContext.userProperties.CustomProperties object: