Skip to main content
Solved

Invalid client when access token

  • 19 December 2023
  • 6 replies
  • 322 views

Forum|alt.badge.img

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

 

Best answer by jinin

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.

View original
Did this topic help you find an answer to your question?

6 replies

jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • 659 replies
  • Answer
  • December 19, 2023

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.


RohitRattan88
Acumatica Employee
Forum|alt.badge.img+4
  • Acumatica Employee
  • 245 replies
  • December 19, 2023

@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)


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • 44 replies
  • December 20, 2023

Can we use Resource Owner Password Credentials with http 


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • 44 replies
  • December 20, 2023
jinin wrote:

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"}


RohitRattan88
Acumatica Employee
Forum|alt.badge.img+4
  • Acumatica Employee
  • 245 replies
  • December 20, 2023

@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


Forum|alt.badge.img+1

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings