Solved

Connecting To Authorization Endpoint - OAuth Authorization Flow

  • 17 May 2021
  • 3 replies
  • 2310 views

Userlevel 1

Hi,

I’m trying to test Acumatica’s OAuth Authorization flow using Postman. I need to implement an API that will generally be called from a website (our customer portal) and return some information from our company’s Acumatica via OData.

I followed the steps in the I300 Web Services course: https://openuni.acumatica.com/courses/integration/i300-web-services-basic-data-retrieval/

as well as in the reference documents: https://help-2021r1.acumatica.com/(W(2))/Wiki/ShowWiki.aspx?pageid=2930d2f7-e081-4d0e-8879-93907ce82607

I am able to use the Resource Owner Password Credentials flow successfully, but we need to implement the Authorization flow, using a client_id + client_secret approach.

I already created a Client in the Connected Applications screen, and set the flow to Authorization Code.

Please correct me if I’m wrong: I understand that every time this API will be called, it will need to first request an authorization code from (GET) https://<Acumatica ERP instance URL>/identity/connect/authorize, and then use that code to get a token from (GET) https://<Acumatica ERP instance URL>/identity/connect/token. Then that token can be used to successfully authenticate our main API call to retrieve information from OData.

When I try to test the first part of this process in Postman (retrieving the authorization code) I’m just getting this:

If I try the URL directly in the browser with the same parameters, I get this:

 

Could you please let me know what am I doing wrong?

I’m currently using https://oauth.pstmn.io/v1/callback as the redirect uri value (and I also included it in the client’s Redirect URIs page in the Connected Applications screen in Acumatica). In fact I would also like to know what should I use as the redirect uri if all this will be initially triggered by a javascript function when the website loads, which will trigger an API call to a function in AWS, which will run the authentication/token calls above.

(Any comments or suggestions to help improve this process are more than welcome)

 

Thanks in advance!

icon

Best answer by jchavez 19 May 2021, 18:06

View original

3 replies

Userlevel 1

Please disregard this question. I was able to finally make it work.
For some reason when I disactivated and activated the client in the connected applications screen, it started working properly.

Please disregard this question. I was able to finally make it work.
For some reason when I disactivated and activated the client in the connected applications screen, it started working properly.

Hi, 

 

I have been trying to build a Custom Connector for PowerAutomate and I am getting the same screen when I try OAuth2.0. I have tried Basic Auth and it keeps saying “You are not logged in”. 

I followed your example and re-created a new connected applications but it is still giving me that same error

I would appreciate any help or input you can give me. 

 

Thank you, 

Elsa 

 

Userlevel 1

Please disregard this question. I was able to finally make it work.
For some reason when I disactivated and activated the client in the connected applications screen, it started working properly.

Hi, 

 

I have been trying to build a Custom Connector for PowerAutomate and I am getting the same screen when I try OAuth2.0. I have tried Basic Auth and it keeps saying “You are not logged in”. 

I followed your example and re-created a new connected applications but it is still giving me that same error

I would appreciate any help or input you can give me. 

 

Thank you, 

Elsa 

 

Hi Elsa,

In my case it was apparently a cache issue that was resolved after multiple attempts of disactivating and activating back the client.
I know that there’s another screen called External Applications, which I understand is designed to work with Power BI. I know it’s not what you are using but you could give it a try.

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