HI, i am using this docker-compose <https://github...
# talk-keto
m
HI, i am using this docker-compose https://github.com/gen1us2k/ory_workshop/tree/master/keto for running keto server, and i configured cors for keto in keto.yml file which now looks like this
version: v0.6.0-alpha.1
log:
level: debug
namespaces:
- id: 0
name: models
dsn: memory
serve:
read:
host: 0.0.0.0
port: 4466
write:
host: 0.0.0.0
port: 4467
cors:
allowed_origins:
- <http://localhost:3000>
but when i run the docker-compose up i get the following output
d
You need to set
cors
settings under
read
and
write
configuration settings
CORS configuration should look like
serve.read.cors
or
serve.write.cors
(depends on what you want to expose to the public internet). Right now your configuration looks like
serve.cors
that leads to configuration error
However, you shouldn’t expose Keto endpoints to the public internet because it doesn’t have any authentication/authorization mechanisms
m
okay Than how am i going to implement it with frontend like react, they will use browser
is this the right way
version: v0.6.0-alpha.1
log:
level: debug
namespaces:
- id: 0
name: models
dsn: memory
serve:
read:
host: 0.0.0.0
port: 4466
cors:
allowed_origins:
- <http://localhost:3000>
write:
host: 0.0.0.0
port: 4467
cors:
allowed_origins:
- <http://localhost:3000>
d
Yep.
m
but i still get the cors error
message has been deleted
d
You can copy configuration snippet from ory Kratos guide of how to setup CORS
Copy code
serve:
  read:
    cors:
      enabled: true
      allowed_origins:
        - <http://localhost:3000>
      allowed_methods:
        - POST
        - GET
        - PUT
        - PATCH
        - DELETE
👀 1
m
Still getting the cors error
version: v0.6.0-alpha.1
log:
level: debug
namespaces:
- id: 0
name: models
dsn: memory
serve:
read:
host: 0.0.0.0
port: 4466
cors:
enabled: true
allowed_origins:
- <http://localhost:3000>
allowed_methods:
- POST
- GET
- PUT
- PATCH
- DELETE
allowed_headers:
- Authorization
- Cookie
- Content-Type
exposed_headers:
- Content-Type
- Set-Cookie
# allowed_origins:
#   - <http://localhost:3000>
write:
host: 0.0.0.0
port: 4467
cors:
enabled: true
allowed_origins:
- <http://localhost:3000>
allowed_methods:
- POST
- GET
- PUT
- PATCH
- DELETE
allowed_headers:
- Authorization
- Cookie
- Content-Type
exposed_headers:
- Content-Type
- Set-Cookie
# allowed_origins:
#   - <http://localhost:3000>
with above configuration as well
d
What kind of error do you get?
m
message has been deleted
message has been deleted
@magnificent-actor-67130
@damp-sunset-69236?
@damp-sunset-69236 Anything on this?
d
Hello. Do you use
withCredentials
option for your frontend app?