Microsoft Graph API Permissions for non-admins?

Copper Contributor

I am trying to create a dropdown with all the users in my Office365 tenant. I created an app in Azure AD and gave it all the necessary permissions. I gave it all the permissions for Microsoft Graph actually, app and delegated. All of them.

 

Then I wrote up my script to query all users with `https://graph.microsoft.com/v1.0/users`.

 

I had my tenant admin go in and accept the permissions then output the list of users in the UI. Works fine for them.

 

I'm not an admin but when I go to the page I get the following error:

 

This application requires application permissions to another application. Consent for application permissions can only be performed by an administrator. Sign out and sign in as an administrator or contact one of your organization's administrators.

 

 

I need to know if this will work for users with even lower permissions. From what I understand the API request and the App is running under the permissions given to the application in Azure. So even if the user as Read Only, the request isn't running under the user, it's running under the Application I set up. So why would I get the error regarding permissions?

 

2 Replies

Hi Kessy,

 

normally it runs under the credentials you are logged in with at least the calls in SharePoint. Offcourse your app in Azure needs the correct base permissions which your admin need to set.

 

i am guessing it could be a wrong permission on the manifest in your app.

Okay what I did was reduce that Apps permissions to only items at did not require Admin access. It seems to be working but I'm pretty disappointed.

 

I thought that if I gave the App a certain permissions, the API would use the App context to make the request instead of the User context.