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

Community site session details

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

AADSTS900144 body must contain 'client_id' AcquireTokenByAuthorizationCode

(0) ShareShare
ReportReport
Posted on by 71

Hi,

When using the AcquireTokenByAuthorizationCode in codeunit OAuth2 to call a business central API in OAuth, I consistently get this error message

pastedimage1683128288456v1.png

Which I don't understand since I'm sending a client ID.

Is there a certain way to call this procedure ? 

I have the same question (0)
  • Suggested answer
    Yogender Singh Rana Profile Picture
    80 on at
    RE: AADSTS900144 body must contain 'client_id' AcquireTokenByAuthorizationCode

    Hi Valentine Motin,

    I hope you have created a Client ID and Client Secret from the Azure active directory. 

    If not, please create using this link - support.smartbear.com/.../tutorial-azure.html

    Or please explain the issue as the screenshot is having a language that I don't understand.  Share the process from which you are getting error. 

    Regards,

    Yogender Singh Rana

  • Suggested answer
    Nitin Verma Profile Picture
    21,684 Moderator on at
    RE: AADSTS900144 body must contain 'client_id' AcquireTokenByAuthorizationCode

    Please use below link to check if you have correctly setups the OAuth2.0 app registration

    www.navwithnav.com/.../

  • Valentine Motin Profile Picture
    71 on at
    RE: AADSTS900144 body must contain 'client_id' AcquireTokenByAuthorizationCode

    Hi Yogender, thanks for your reply.

    Part of the message in the window is in french and only says Sorry we re having troubles to connect you. I will try to detail my process a bit.

    What I want to do is to expose an API in Business central, and to call this same API in business central (so I am auto calling my own API in the same base, I have reasons to set it up that way).

    The setup was working fine using Basic Authentification but I am now trying to make it work using OAuth On Premise.

    I set up the OAuth authentification on my On Premise business central (with a client secret), it works well and I can call my API in postman. The grant type in Postman is setup to Authorization Code.

    What I now need to do is to call this API in AL in business central.

    I have done this before in Basic Auth and in OAuth with another API but the existing procedure in the codeunit OAuth2 "AcquireTokenByAuthorizationCode", that seems to be exactly what I'm looking for, does not work.

    When I try to call this procedure, with the same parameters that i've used in postman, I get the error message linked in my first post that indicates that the body should contain 'client_id', which I don't understand since I don't have control on this procedure appart from the parameters that i send.

    That's why I was wondering is there was any known issue regarding this specific procedure.

    Hope I cleared things out enough.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,237

#2
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 3,425

#3
Sumit Singh Profile Picture

Sumit Singh 2,907

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans