azure-active-directoryimapexchange-basicauth

Oauth2 IMAP: How to request consent for 'IMAP.AccessAsUser.All' permission for an app registered in Azure AD


I am trying to request consent for 'IMAP.AccessAsUser.All' permission from user, so that my app can access the user's inbox via OAuth2.

But when i request for permission I get the following error. See attached image.

The application asked for scope 'IMAP.AccessAsUser.All' that does not exist on resource.

Below is the url of the consent link. Could someone help with how I can get consent for this permission 'IMAP.AccessAsUser.All'chan

https://login.microsoftonline.com/common/oauth2/v2.0/authorize?
client_id=b0eb0e00-ec46-4df8-a710-491468ed4f37
&response_type=code
&redirect_uri=https%3A%2F%2Fimap.mailboxsync.test.com%2Fredirect%2F
&response_mode=query
&scope=openid%20offline_access%20https%3A%2F%2Foutlook.office365.com%2FIMAP.AccessAsUser.All
&state=12345

Solution

  • I can reproduce your issue, you need to add the API permission as below.

    Navigate to the Azure Active Directory -> App Registration in the portal, find your app. Follow the screenshot below.

    enter image description here

    enter image description here