web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Web service call failed because user could not be authenticated or authorized

(0) ShareShare
ReportReport
Posted on by

I would like to share this information with all of you

Issue Summary:

if you are calling the Business Central REST API via OAuth2 authentication fails with the error message "Web service call failed because user could not be authenticated or authorized."

and in the event viewer, you got this warning 

pastedimage1673250084984v1.png

RCA:

When you create the APP reg in the Azure portal and add the needed params to your postman or any tool that you used to generate the token, the token is generated correctly

If you take this token and use this link: JSON Web Tokens - jwt.io 

This link is very helpful to show you the token data added so you will find it missing an important part which is ( Roles )

pastedimage1673250270542v2.png

This issue related to the wrong scope added to the request being wrong

pastedimage1673250386816v4.png

It should be https://api.businesscentral.dynamics.com/.default

I have the same question (0)
  • Verified answer
    Microsoft Dynamics 365 Business Central Profile Picture
    on at

    not a question

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,577

#2
YUN ZHU Profile Picture

YUN ZHU 888 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 778 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans