I have enabled `oauth2.serve.public.cors` and add ...
# ory-network
q
I have enabled
oauth2.serve.public.cors
and add CORS origins to my oAuth2 credentials. The
/oauth2/token
endpoint still gives CORS errors. What else could I be doing wrong here 🤔
h
ory network or self managed?
q
Ory Network
h
have you configured cors on the oauth2 client as well?
q
Yes! Just with the domain and protocol
I noticed the oAuth2 config yaml has the path for the callback endpoint. I will just remove the path part for that as well. Things are not working for localhost as well though
h
are you using a custom domain?
q
No custom domain for the Ory. We will have different frontend domains making a request to the same Ory instance
h
ok, i won’t have time to investigate today. with custom domains, it definitely should work when you set up cors. for hydra, it’s possible that there is some issue preventing the correct cors headers. is this blocking you right now? you could also use the ory tunnel as a workaround i think
q
It is blocking the Demo oAuth SPA which I am building to showcase Ory Hydra oAuth implement with custom page. I can use the Postman or some CLI to demo the Ory Hydra oAuth but it is not as cool as using a SPA 😛 What could I be missing here? Maybe I am doing something wrong?
h
It could be problem on our end, but we need to confirm that first
q
I see. Thanks. Please do let me know so I can resume the work on the demo 🙏
h
Could you please create an issue in ory/network where you explain what you tried and what didn’t work, plus if possible a reproducible path. For example using CURL or postman