Solved

Acumatica authentication with angular 10 (blocked by CORS policy)

  • 8 January 2021
  • 4 replies
  • 357 views

hello, i'm trying to implement the authentication, i want to check the feasibility of connecting an angular client to acumatica if is possible i want to get solution.

Best regards.

 

icon

Best answer by Gabriel Michaud 8 January 2021, 18:27

View original

4 replies

Userlevel 7
Badge +10

You will have to setup a reverse proxy to work around the CORS restrictions. We faced a similar problem when working on the browser-based version of our popular Excel reporting add-on, Velixo Reports and implementing the proxy with nginx.

Depending on the stack you use you might want to use something different; there’s many open source projects out there if you want to research this further:

If you have access to the web.config file of the site you are integrating with, you could also modify it to allow cross-origin requests, but I don’t recommend this if you’re building an application that will support multiple instances hosted in different locations.

thank you Gaberiel for this response, I have a test for the moment with webconfig and I will search with another idea.

 

Did you ever get this working without having to set up a proxy?  I’ve recently run into this same issue.

Acumatica provides instructions for configuring CORS for OData access.  But My JS requests still fail. I’ve tried from Chrome and Firefox, and both browsers refuse to allow CORS.  I even tried a couple browser extensions with names like “CORS Everywhere” with the same result.
Typically fails in the pre-flight OPTIONS request, before it even gets to the GET request. Error messages like “The Same Origin Policy disallows reading the remote resource” and “CORS header ‘Access-Control-Allow-Origin’ missing”.

Userlevel 7
Badge +10

@jetzerb08 nope, we are relying on a secure CORS Proxy for the web-based version of our product. I recall trying to modify the web.config for web services and being unsuccessful as well… I suggest reaching out to Acumatica support.

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