Solved

unauthorized_client when getting token using resource owner password credentials flow

  • 20 September 2022
  • 2 replies
  • 435 views

Userlevel 1
Badge
{
'client_id': "xxxxxxx@company",
'client_secret': "xxxxxxxxxx",
'grant_type': 'client_credentials',
# 'grant_type': 'password',
'scope': "api",
'username': 'xxxx',
'password': 'xxxx',
}

This is the body I am sending, but I am getting `{'error': 'unauthorized_client'}` what am I missing?

Secondly, the documentation says the grant_type must set to `password`, but if I do that, I get `invalid_grant`

icon

Best answer by jamesl 12 October 2022, 21:48

View original

2 replies

Userlevel 4
Badge +2

You seem to be attempting to connect application using the Access Token Request Endpoint. 

Is your application set up on the SM.30.30.10 Connected Applications Screen within Acumatica? 

Also your request body seems to be missing the redirect URI for Acumatica to send requests to your application.

I think this is the documentation you are referring to in your question

https://help-2022r1.acumatica.com/Help?ScreenId=ShowWiki&pageid=ff780860-09c2-46c9-bdd7-c6c3b1fc442c

Userlevel 1
Badge

You seem to be attempting to connect application using the Access Token Request Endpoint. 

Is your application set up on the SM.30.30.10 Connected Applications Screen within Acumatica? 

Also your request body seems to be missing the redirect URI for Acumatica to send requests to your application.

I think this is the documentation you are referring to in your question

https://help-2022r1.acumatica.com/Help?ScreenId=ShowWiki&pageid=ff780860-09c2-46c9-bdd7-c6c3b1fc442c

Thanks for the reply, unfortunately the unauthorized error was due to `'grant_type': 'client_credentials'`, which is not accepted in Acumentica, The correct grant_type was actually `password`. 

When I had `grant_type` being `password` and got the `invalid grant` error, it was due to the admin not setup the API access correctly.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved