Hi @AV
This is an expected error, as your error message states, your administrator has not consent the IMAP.AccessAsUser.All
permission of the outlook resource.
You can of course add permissions to outlook, the easiest way is to use the admin consent URL. You just need to run this URL in the browser, then log in with an administrator and consent.
https://login.microsoftonline.com/{tenant id}/v2.0/adminconsent
?client_id={client id}
&scope=https://outlook.office.com/IMAP.AccessAsUser.All
&redirect_uri={redirect url}
&state=12345
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.