One of my project where we are displaying the group claims from Azure AD is failing because the user is part of a huge number of groups. Is there a way to check if the logged in user is part of a specific group and dispaly / filter the group claim to show only specific groups?
Check if a user is part of a specific group using Azure B2C claims
762 views Asked by Sandesh Segu At
1
If you are using Microsoft Graph API to get the group claim, you can filter with the group id like this:
Obviously this requires you to know the group id in advance. Group name is not supported to filter.
You can also get all the groups by
https://graph.microsoft.com/v1.0/users/{user id}/memberOf
and filter the group name in your own code. Then return the filter result to the group claim.