CORS Policy Set to Wildcard but still showing restrictions | Community
Skip to main content
New Participant
Jan 29, 2019 10:47 PM UTC
Solved

CORS Policy Set to Wildcard but still showing restrictions

Hello All,

I am running into an issue where I am trying to do some testing on my local machine and I have an author and publish server currently running. For testing I have set the CORS policy to be a wildcard so that I can reference AEM components and html from my local machine. The problem is I am still getting the CORS policy restrictions even though I have changed that configuration to "*" for a wildcard to accept everything.

I was wondering if there are any steps I have to take after updating the CORS policy for it to take affect.

Thanks advance!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Gaurav-Behl
Gaurav-BehlAccepted solution
Level 10
Jan 30, 2019 12:27 AM UTC

I don't see "Access-Control-Allow-Origin" in supported Headers in this configuration

In addition to that, you may uncheck the supports credentials if you plan to access the content anonymously otherwise add more headers like "Access-Control-Allow-Credentials"

In theory wildcard should work, but you may want to create another entry with exact origin as well "localhost:8885" since I haven't tested it with wildcard

9 replies

New Participant
Jan 30, 2019 12:37 AM UTC

Adding Access-Control-Allow-Origin in the supported headers did the trick! Thank you very much for your assistance!

Translate
Gaurav-Behl
Gaurav-BehlAccepted solution
Level 10
Jan 30, 2019 12:27 AM UTC

I don't see "Access-Control-Allow-Origin" in supported Headers in this configuration

In addition to that, you may uncheck the supports credentials if you plan to access the content anonymously otherwise add more headers like "Access-Control-Allow-Credentials"

In theory wildcard should work, but you may want to create another entry with exact origin as well "localhost:8885" since I haven't tested it with wildcard

Translate
New Participant
Jan 30, 2019 12:17 AM UTC

A bit confused by the XML examples, where would I find this configuration?

Translate
New Participant
Jan 30, 2019 12:13 AM UTC

HI gauravb10066713,

I have it set up like this:

Translate
Gaurav-Behl
Level 10
Jan 30, 2019 12:10 AM UTC

The source doesn't have the headers enabled as mentioned in screenshot. Where did you set the wildcard?

Follow this article to enable CORS at server if you are dealing with local apps accessing author/publish without dispatcher as mentioned in your case-

Adobe Experience Manager Help | Understanding Cross-Origin Resource Sharing (CORS) with AEM

Video - Adobe Experience Manager Help | Developing for Cross-Origin Resource Sharing (CORS) with AEM

You don't need dispatcher configs since you access the publish directly.

Translate
New Participant
Jan 29, 2019 11:51 PM UTC

These are the errors I am seeing in console

Translate
antoniom5495929
Level 7
Jan 29, 2019 11:04 PM UTC

Hi,

could you share a screen of the error?

Just to be sure.

Thanks,

Antonio

Translate
New Participant
Jan 29, 2019 10:59 PM UTC

I have a standalone HTML file that is referencing the HTML code from AEM and in the console I see that it is unable to be loaded due to CORS restrictions from "null" even though it should allow everything to access the HTML

Translate
antoniom5495929
Level 7
Jan 29, 2019 10:54 PM UTC

Hi,

which kind of issue are you facing? Could you add more details regarding the issue?

Thanks,

Antonio

Translate