0
votes

In our application we use EWS and basic authentication. An user can get access to own mailbox only or to all mailboxes in his organization if he has admin credentials. Now we are trying to replace basic authentication with OAuth2 authentication. We registered the application on Azure portal, added the permission "EWS.AccessAsUser.All".

For an admin account everything works well. Our application can get access to any mailbox in admin's organization.

The problem is in that we cannot get an authorization code for a standard user account. "TestApp needs permission to access resources in your organization that only an admin can grant" is shown.

So the question is: is there a way to get access to user's mailbox using EWS, OAuth2 and user's credentials?

1

1 Answers

1
votes

With oAuth you need to grant consent for your application in a Tenant eg https://docs.microsoft.com/en-us/azure/active-directory/manage-apps/grant-admin-consent once you have granted tenant wide consent any user should be able to use the application unless you apply restrictions. If your application is being used by other companies then you need to have a Multi Tenant application registration and the client will need to consent to its use in their tenant before they can use it.