OAuth integration with O365 fails with error AADSTS65005

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

OAuth integration with O365 fails with error AADSTS65005

Message par ForumBot »

OAuth integration with O365 fails with error AADSTS65005
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: OAuth integration with O365 fails with error AADSTS65005

Message par ForumBot »

By default, a registered app is configured to request "Read the user's profile", which once consented to by the user, allows the app to get a user token (id token if using OpenID Connect) and read the signed in user's profile (including their mail address or addresses) when calling the [Azure AD Graph API](http://msdn.microsoft.com/library/azure/hh974476.aspx). Apps secured by Azure AD must currently configure the permission scopes they require up front (as part of the app registration experience, under the "Permissions to other applications" section).
Here it looks like you've specified Outlook.com as the resource that you'd like a code and access token for, but your app is not configured to allow access to O365 Outlook.com/Exchange Online.

Please try setting the resource in your request to Azure AD - [https://graph.windows.net/](https://graph.windows.net/). That *should* work for you. You can then swap the code for an access token to call the Azure AD Graph API.

Hope this helps
Répondre

Revenir à « Excel & VBA »