Skip to content

Conversation

@pamelafox
Copy link
Contributor

This WIP branch shows how to use the Graph API with OBO flow to find out the groups of the signed in user, and use that to decide whether to allow access to a particular group.

First it modifies the Entra App registration process to grant admin consent. This is required since we do not have preauthorized applications:
https://learn.microsoft.com/entra/identity-platform/v2-oauth2-on-behalf-of-flow#admin-consent

Then in the actual tool, we use the graph API to list the user's memberships:
https://learn.microsoft.com/en-us/graph/api/user-list-memberof?view=graph-rest-1.0&tabs=http

We only receive back the ID of the groups, no other metadata, as that would likely require higher permissions, like User.Read.All:
https://learn.microsoft.com/en-us/graph/permissions-reference#userreadall

All we need is the ID, however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants