My web app (ConfidentialClientAplication
) performs some background tasks for my users:
Mail.ReadWrite
)$DYN365_BASE_URL/data/Companies
(using Connector.FullAccess
)For reference here is a screenshot of the permissions the app is using:
(Figure 1: App registration permissions)
--
In my webb app the user clicks a button to connect their MS365 tenant with my app, requesting the required permissions using the authorization code flow:
(Figure 2: Consent Screen)
I now have an access_token
and also a refresh_token
(using MSAL for Java).
I can now successfully:
So far, so good.
--
Now, after 60minutes my access_token
is expired and I need to get a new one using the refresh_token
. So, I do that.
Using the new access_token
I can
AADSTS65001: The user or administrator has not consented to use the application.
--
We found a rather simple solution: we needed to also add the Odata.FullAccess
permission in the Azure portal.
Using the following set of permissions the code worked fine without any further modifications:
We also experimented with using less permissions. But it looks like all of the permissions are required for our use case.