How to implement admin consent flow for native app

2019-04-29 11:21发布

问题:

How can I implement admin consent flow for native app using O365 APIs of which permission scopes require admin consent?

回答1:

Admin Consent happens "out of band" from your normal authentication flow. To do this, you'll first need and Admin authenticate by going to:

https://login.microsoftonline.com/common/adminconsent?<yours params>.

You can provide this link within your app. Typically you would first attempt to authenticate them and present them with the Admin Consent option that process fails.

Once an Admin grants consent, users will be able to use OAUTH to authenticate via the standard endpoint:

https://login.microsoftonline.com/common/oauth2/authorize?<your params>