Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

Entitlement error when connecting API (Postman) to BC

Posted on by

Putting error and solution here.

Issue:

When connecting S2S Oauth using Postman to BC you get this error in Postman:

        "code""Authentication_InvalidCredentials",
        "message""Web service call failed because user could not be authenticated or authorized. 

More symptoms (OnPrem): In the Application log on the BC Server you get two warnings:

First this one:

Message: User signed in with the following information: user type=Normal user, entitlement set Ids=, authorization status=Failed, guest user=False, failure reason=A user successfully authenticated in Azure Active Directory but the user does not have any entitlements in Business Central.

Then this one:

MessageWithoutPrivateInformation: Your account has been authenticated with Azure Active Directory, but there is no valid license assigned to your account in Business Central. Contact your system administrator to get a valid license assigned to you.

Solution (At least in my case this was the solution):

In Postman under Advanced Options, set Resource = https://api.businesscentral.dynamics.com/

pastedimage1677235078648v1.png

Additional info:

Note that after specifying Resource as show above, this section gets added to the token (decoded in https://jwt.ms/):

"roles": [ "Automation.ReadWrite.All",

"app_access",

"API.ReadWrite.All" ]

  • Verified answer
    Marga Profile Picture
    Marga 575 on at
    RE: Entitlement error when connecting API (Postman) to BC

    Thank you for sharing Lars!

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans