I've asked my IT Admin to add an attribute called EmployeeId
in the form of a directory extension to azure active directory which syncs with our onsite AD. I'm trying to retrieve this value for a given user when they sign into my android app.
I've followed this guide which has allowed me to retrieve data from the URL graph.microsoft.com
with the currently logged in user i.e. givenname, surname etc.
The issue is that when I run the get request for schema extensions (https://graph.microsoft.com/beta/schemaExtensions
) to try to retrieve the value of EmployeeId
it just returns some metadata about the attribute, not the attribute it'self:
{
"id": "exti1rcdc4h_Employee",
"description": "Baker is testing extension",
"targetTypes": [
"user"
],
"status": "Available",
"owner": "XXXXXXXXXXXXXXXXXX",
"properties": [
{
"name": "EmployeeId",
"type": "Integer"
}
]
}
After doing some research I've found that i can use this graph explorer to easily retrieve the value (by using the get request https://graph.windows.net/mydomain.com/users/user@mydomain.com
).
The issue is however that the URL graph.explorer.net
doesn't seem to be compatible with the guide mentioned above.
Is there a better way to approach this issue?
--EDIT--
Just to clarify I was only able to retrive the value for extension_980f32feca7d475f9e1b90a410dbee63_employeeID
successfully using the Azure AD Graph explorer the value is not returned when i access the /users endpoint on Microsoft graph explorer
Data returned for each user in GET https://graph.microsoft.com/v1.0/users
request:
"id": "d0be2ebd-0c7b-4c10-aebe-9db4c90a9594",
"businessPhones": [],
"displayName": "username",
"givenName": "Jhon",
"jobTitle": null,
"mail": "user@mydomain.com",
"mobilePhone": null,
"officeLocation": null,
"preferredLanguage": null,
"surname": "Smith",
"userPrincipalName": "user@mydomain.com"