Hi,
When using the AcquireTokenByAuthorizationCode in codeunit OAuth2 to call a business central API in OAuth, I consistently get this error message
Which I don't understand since I'm sending a client ID.
Is there a certain way to call this procedure ?
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.
Please use below link to check if you have correctly setups the OAuth2.0 app registration
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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,134 Super User 2024 Season 2
Martin Dráb 229,928 Most Valuable Professional
nmaenpaa 101,156