Custom Attributes/Properties in AAD .. Finding the

2019-08-10 17:46发布

问题:

I have large AAD Dynamic group that I need to search and query membership for (100K+ member group) and search for users by name. This group is generated based on a custom attribute on the user in AAD.

I am trying to figure out if I can get this information out the MS Graph or if I need to move these calls to the AAD Graph ?

I've checked the users for extensions and schema data but there doesn't seem to be anything there.

Are custom attributes not replicated in MS Graph?

The problem I am trying to solve is:

I have a people picker that I want to return results that satisfy membership of a this group. The problem is MS Graph doesn't support OData queries of the members of a group on their displayName. Since the group is driving by the custom attribute I was hoping to take a short cut and include that in my query

回答1:

You may need to get the custom attribute with AAD Graph instead of MS Graph, seems the MS Graph will not return the custom attribute.

Sample of AAD Graph:

GET https://graph.windows.net/{tenant}/users/{objectId}

returns:

{
    "odata.metadata": "https://graph.windows.net/{tenant}/$metadata#directoryObjects/Microsoft.DirectoryServices.User/@Element",
    "odata.type": "Microsoft.DirectoryServices.User",
    "objectType": "User",
    ...
    "extension_917ef9adff534c858b0a683b6e6ec0f3_CreatedTime": 1518602039
}

Here are two posts related to this issue, see : How to get/set custom Azure Active Directory B2C user attributes in ASP.NET MVC? and How to read Azure B2C Custom Attributes with Graph API (works OK with Azure AD Graph)