I've been helping a few people lately with this and I see the same few issues that continually trip people up.
Table to help decide whether to use the v2.0 endpoints or not.
And note that currently the "Resource owner password credentials" grant is not supported.
Have a look at the current restrictions.
The endpoints are different:
https://login.microsoftonline.com/common/oauth2/v2.0/authorize
https://login.microsoftonline.com/common/oauth2/v2.0/token
The scopes are different. They now take the form of a URI e.g.
"scope": "https://outlook.office.com/mail.read https://outlook.office.com/mail.send"
You can use the default scope e.g.
https://graph.microsoft.com/.default
This means that the application uses the pre-defined scope.
You need to use the Application Registration Portal to register the application. Don't use the usual Azure AD Applications screens.
You need to cater for the admin. consent endpoint if you want to grant consent for the application to anyone who can authenticate.
Use the MSAL library rather than the ADAL library.
Enjoy!
No comments:
Post a Comment