0

I can see that Microsoft is in a process of rolling out official support for OAUTH support for IMAP requests. I want to access this functionality now. There are few proposed solutions, but they are using hacks and undocumented features or simply fail.

Using Microsoft Hotmail/LIVE OAUTH + IMAP - Here, when I add EWS.AccessAsUser.All to scope in OAuth requesst, I get {"error":"invalid_scope","error_description":"AADSTS70011: The provided request must include a 'scope' input parameter. ... }. The probable reason is that this solution is for personal outlook (not O365) accounts and for desktop app.

Using login.live.com auth endpoint - Not working for me using https://login.microsoftonline.com/common/oauth2/v2.0/authorize auth endpoint.

Are you aware of any documented, safe method of connecting to outlook.office365.com using oauth tokens acquired from https://login.microsoftonline.com/common/oauth2/v2.0/authorize endpoint?

Jan Jurec
  • 49
  • 1
  • 13

1 Answers1

0

You are using client credentials grant flow which is not supported.

For alternative You can use any of these

  1. OAuth2 authorization code flow

  2. OAuth2 Device authorization grant flow

If you would still looking to use Client credentials the grant flow we recommend you to use the Microsoft Graph APIs which allow access without a user.

Raghavendra beldona
  • 1,937
  • 1
  • 4
  • 9