CORS issues on stage author/publisher | Community
Skip to main content
New Participant
January 30, 2023
Solved

CORS issues on stage author/publisher

  • January 30, 2023
  • 1 reply
  • 1949 views
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Nitin_laad

Hi @nitin_laad, screenshot here.

 

 


Check this out -

The CORS and Referrer filter should be configured to enable the access for external systems

https://www.albinsblog.com/2021/10/how-to-deliver-headless-content-through-graphql-api-and-content-fragments-in-aem.html#.Y43LD3ZBw2z:~:text=Consume%20GraphQL%20API%20Data%20from%20External%20System%3A

1 reply

Kiran_Vedantam
New Participant
January 30, 2023

Hi @kam-nyc 

 

Can you please be more specific on what you are trying to achieve? The CORS behavior, commonly termed CORS error, is a mechanism to restrict users from accessing shared resources. This is not an error but a security measure to secure users or the website you are accessing from a potential security breach.

 

If you are trying to test something in your locally, you can always use extensions available for your browser. If you want to fix it for your public faced environments, you should whitelist the IP in both source and destination.

 

Hope it helps!

Thanks,
Kiran Vedantam

Kam-nycAuthor
New Participant
January 30, 2023

Hi Kiran,

 

This is front end ajax call. a.com ajax get data from b.com - error - "has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource."

b.com has to allow origin "a.com". You can config this on Adobe Granite Cross-Origin Resource Sharing Policy. But it didn't work.

 

Thanks,

Kam

Nitin_laad
New Participant
January 30, 2023

Hi @kam-nyc 

The error occurs because the server has not been configured to allow CORS requests from the domain that is making the AJAX call. The browser blocks the request because it does not have the necessary headers, such as Access-Control-Allow-Origin, which tell the browser that it is allowed to make the request.To resolve this issue, the AEM or CQ5 server must be configured to allow CORS requests from the domain that is making the AJAX call.

Can you share the screenshot of the configuration you have made into the author/publish server