Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enables Client Credentials to call Microsoft Graph #109

Merged
merged 8 commits into from
May 3, 2021

Conversation

roryclaasen
Copy link
Contributor

@roryclaasen roryclaasen commented Oct 19, 2020

There is a setting in Microsoft Azure Active Directory that prevents guest users from retrieving graph data. Including the group display name, which is used in group synchronization.

https://docs.microsoft.com/en-us/azure/active-directory/users-groups-roles/users-restrict-guest-permissions

With this setting set to restricted, the graph api returns empty group objects and therefore doesn't sync groups.

This PR adds a new option to allow the use of client credentials. So instead of granting an application Directory.AccessAsUser.All (Delegated) you need to give it Directory.Read.All (Application).
Directory.Read.All is the least most privileged permission required as per https://docs.microsoft.com/en-us/graph/api/user-list-transitivememberof.

As the application permissions are granted for the tenant, this setting cannot be used with multi tenant enabled.

The initial authContext.acquireTokenByAuthorizationCode is still required to retrieve the user information from the id token claims, as authContext.acquireToken wont retrieve this data.

@roryclaasen roryclaasen changed the title Enables Client Credentials Enables Client Credentials to call Microsoft Graph Oct 19, 2020
@roryclaasen roryclaasen marked this pull request as ready for review October 19, 2020 16:20
@roryclaasen
Copy link
Contributor Author

@hkamel @srvrguy Bumping this PR

My team would rather use an official build rather than a local built of the plugin and so if this PR could get feedback/merged that'll be great

@hkamel hkamel merged commit 92339be into hkamel:master May 3, 2021
@roryclaasen roryclaasen deleted the feature/client-credential-flow branch May 4, 2021 08:02
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