dfoxg / kratos-admin-ui

A simple Admin-Interface for ory/kratos
MIT License
138 stars 28 forks source link

CORS issue #82

Closed aydinnyunus closed 1 year ago

aydinnyunus commented 1 year ago

I change the Admin URL on public/config.json to my domain admin.example.com:4434 and public to public.example.com:4433 and also edit the cors-proxy.js but still got a cors error.

dfoxg commented 1 year ago

Your webservers (admin.example.com, public.example.com) have to send the cors headers.

Have a look here: https://www.google.com/amp/s/auth0.com/blog/amp/cors-tutorial-a-guide-to-cross-origin-resource-sharing/

aydinnyunus commented 1 year ago

@dfoxg thank you i solved it by using wildcard *. but i dont want to use wildcard domain how can i add more domains on cors-proxy.js file ? when i do it i get an error has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values 'http://IP, http://IP2', but only one is allowed. or how can i add authorization header check on apis

dfoxg commented 1 year ago

The cors-proxy.js is only for local development, don't use it in production! As I mentioned before, you have to set the cors headers on your webservers.