Solved

Invalid client when access token

  • 19 December 2023
  • 6 replies
  • 173 views

Userlevel 3
Badge

I try to connected application and I receive authorization code but when I try to get access token, it show error 

I follow this document

 

icon

Best answer by jinin 19 December 2023, 15:52

View original

6 replies

Userlevel 7
Badge +11

Hi @kevinheng21 ,

I didn't work with the Authentication Code but tried with the Resource Owner Password Credentials. Please refer to the document; it may help you.

Userlevel 7
Badge +4

@kevinheng21 

If this is Resource Owner Password Credentials OAuth setup, you would

  1. Get token
  2. use token to perform your task
  3. refresh token if needed
  4. logout to properly end your session

Relevant information could be found at: Resource Owner Password Credentials Flow

for this specific error, make sure your ClientID is correct in token body

Other related discussions:

Invalid_Client error when trying to get a token | Community (acumatica.com)

unauthorized_client when getting token using resource owner password credentials flow | Community (acumatica.com)

Userlevel 3
Badge

Can we use Resource Owner Password Credentials with http 

Userlevel 3
Badge

Hi @kevinheng21 ,

I didn't work with the Authentication Code but tried with the Resource Owner Password Credentials. Please refer to the document; it may help you.

Can we use with http not https ? I try it with http protocol still show error {"error":"invalid_client"}

Userlevel 7
Badge +4

@kevinheng21 

  • According to the OAuth 2.0 specification, a secure connection between an OAuth 2.0 client application and the Acumatica ERP website with a Secure Socket Layer (SSL) certificate is required. Therefore, you have to set up the Acumatica ERP website for HTTPS before the OAuth 2.0 client application can work with data in Acumatica ERP. For more information, see Setting Up an HTTPS Service in Web Server (IIS).

ref: Granting Permission to a Client Application

Userlevel 4
Badge

Hi @kevinheng21 

I noticed from your original screenshot that you are requesting the access token using a JSON format in you request body.  If you still prefer to use the Authorization Code flow, try sending the data as x-www-form-urlencoded instead.

 

 

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