We have an app that uses Office365 OAuth to register and authenticate users (via the allauth.social
Django library).
The problem is, when the Microsoft/Azure tenant is configured to restrict non-admin users from "consent[ing] to apps accessing company data on their behalf", users are not able to register and login.
We have tried to grant admin consent either via https://login.microsoftonline.com/{tenant_name}/adminconsent
and https://login.microsoftonline.com/{tenant_name}/oauth2/v2.0/authorize?prompt=admin_consent
. And although our admin users are able to successfully register and grant the permissions (and also able to retrieve tokens that can be used to impersonate as any user in the tenant), individual users are still not able to register/login to our app, since they are not allowed to complete the OAuth flow. They are just met with the following page:
How do we allow non-admin users to login with OAuth when they are restricted from doing so?
P.S. we are using the Microsoft Graph API
apps.dev
as well. – john2xCalendars.ReadWrite
,Calendars.ReadWrite.Shared
,Contacts.ReadWrite
,Mail.ReadWrite
,Mail.Send
,offline_access
,openid
,profile
,User.Read
(imgur.com/a/W9A4v) – john2x