I've made a command-line app in java that uses the MS Graph api. It interacts with my school's Teams environment, so it largely uses the Education api from MS Graph, which consists almost solely of "admin consent" endpoints.
I have based my app on the "build java apps with microsoft Graph" tutorial: https://learn.microsoft.com/en-us/graph/tutorials/java?tabs=aad
The login in my app is still exactly the same: https://learn.microsoft.com/en-us/graph/tutorials/java?tabs=aad&tutorial-step=3
In Azure AD we (the admin and I) have consented to all the permissions.
But still the app asks for admin consent when someone besides myself tries to log in. It gives the response: 90094 Admin consent is required for the permissions requested by this application. Ask your tenant administrator to provide consent for this application.
My collegues have the same permissions as I have. We've checked and compared, but our accounts seem identical.
It is a mystery to me why my collegues can't log in. Any advice is appreciated.
I tried to reproduce the same in my environment and got the similar error like below:
The error "Admin consent is required for the permissions requested by this application. Ask your tenant administrator to provide consent for this application" usually occurs if the admin consent is not granted to the API permissions of the Azure AD Application.
As mentioned, you have granted Admin consent to the API permissions. To resolve the error, try the below:
Go to Azure Portal -> Enterprise Applications -> Consent and Permissions -> User consent settings
Check whether the Do not allow user consent
is enabled, if yes set the setting to Allow user consent for apps
like below:
Otherwise, try granting tenant-wide admin consent like below:
https://login.microsoftonline.com/
Organisation/adminconsent?client_id=ClientID
Set Assignment required setting as NO
like below: