Hi, I get a CORS error in my angular project (in l...
# ory-network
c
Hi, I get a CORS error in my angular project (in localhost) when I call /.well-known/openid-configuration of my oauth2 system in the ory network. How do I configure the CORS settings. Already tried this via ORY CLI, but when I update the config with "ory update oauth2-config ....", the cors settings are not taken over.
s
For OAuth2, per-client CORS settings are supported. This means that you can set different CORS settings for different OAuth2 clients. You can find the CORS settings in the OAuth2 client settings. CORS has to be enabled for the whole project though.
c
@steep-lamp-91158 Thank you for your quick reply. I get the following error in the CLI: Value for /cors_public/allowed_origins must be valid JSON, but got: [http://localhost] The command: ory patch project myid --replace '/cors_public/enabled=true' --replace '/cors_public/allowed_origins=["http://localhost"]' What am I doing wrong?
Ah okay, I can't set localhost and have to use ory tunnel right?
s
I'm not sure if that is actually true, try
ory patch project myid --replace '/cors_public/enabled=true' --replace '/cors_public/allowed_origins/0="<http://localhost>"'
or other variations