Hello,
I followed the instructions to setup an OAuth2 app from the official documentation and all steps are working and I receive an access and refresh token with all these scopes (including the necessary "Financials.ReadWrite.All" scope):
{
"token_type": "Bearer",
"scope": "ChannelMessage.Send Chat.ReadWrite ChatMessage.Send Directory.Read.All Directory.ReadWrite.All Files.ReadWrite Files.ReadWrite.All Financials.ReadWrite.All Group.ReadWrite.All Mail.ReadWrite Mail.Send Sites.FullControl.All Sites.Manage.All Sites.ReadWrite.All Team.ReadBasic.All TeamSettings.Read.All TeamSettings.ReadWrite.All User.Read.All User.ReadWrite.All profile openid email",
"expires_in": 3997,
"ext_expires_in": 3997,
"access_token": "ey...",
"refresh_token": "0.A..."
}
However, when trying to do a GET request to Dynamics 365 like: graph.microsoft.com/.../companies
I receive the following error with status code 401:
{
"error": {
"code": "Unknown",
"message": "The provided token is unsupported, because it does not contain the necessary claims or signature.",
"innerError": {
"date": "2022-07-11T15:31:36",
"request-id": "4...",
"client-request-id": "4.."
}
}
}
Making a GET request (with the same access token) to graph.microsoft.com/.../me works as expected (the API returns my user data).
I have a Dynamics 365 Trial account and accessing the same account via API worked a couple of months ago with the same user and OAuth2 app without any issues.
Having already double checked all the OAuth app settings, Dynamics 365 User access, and OAuth2 flows, I don't see any other option than to completely delete and recreate the Dynamics account.
Are there any other options or could it be that trial accounts can't access the API anymore or need to be setup to use the API (like it's the case for Business Central On-Premises)?
Thanks in advance!

Report
All responses (
Answers (