Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-node-auth0-custom-authorizers-api example gives me CORS error #120

Closed
saschajullmann opened this issue Mar 25, 2017 · 4 comments
Closed

Comments

@saschajullmann
Copy link

Hi,

I was just trying out the above mentioned example and it didn't work for me. I did everything exactly like the README stated. The error occurs when I'm trying to invoke the API calls (so logging into auth0 and obtaining a token works). Whether I call the public endpoint or the private endpoint it gives me the typical "No 'Access-Control-Allow-Origin' header is present on the requested resource". Even though cors is set to '' (as you can see in the serverless.yml). Even when I specifically enter my sites URL (instead of '') it won't work. When I test the API in the API Gateway console the Access-Control-Allow-Origin is present.

Any ideas?

@christophgysin
Copy link
Contributor

Even though cors is set to '' (as you can see in the serverless.yml).

Your comment makes it sound like you have an empty cors definition in serverless.yml. Are you using the example from current master? See:
https://github.com/serverless/examples/blob/master/aws-node-auth0-custom-authorizers-api/serverless.yml#L27-L35

@saschajullmann
Copy link
Author

I just see I had a typo in my first comment. What I was saying was: "Even though CORS is set to allow '*'. So yeah, I did use the example from the current master (I cloned the repo). I still get the error. And when I manually enable cors in the API Gateway console it has no effect. Maybe I should remove everything and try again.

@saschajullmann
Copy link
Author

Nevermind. I mixed up the API URL -,-. Sorry!

@LightChang
Copy link

I also got CORS error. I checked "Allowed Origins (CORS)" settings in Auth0, "frontend/app.js", and "secrets.json" several time. Even I remove everything and try again. I still got message.
Please help me.
2018-04-15 16 26 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants