In kratos settings, is there a reason for having c...
# general
w
In kratos settings, is there a reason for having cookies.same_site and session.cookie.same_site different? I just set session.cookie.same_site to none for a local instance of kratos, but then noticed the other existed, Should i maybe use that instead?
AI tells me, the global setting is also for the csrf cookies. But its weird it worked to login for me cross-domain with only session.cookie.same_site set
selfservice and kratos instance is on same domain, but got another app on another domain
so the global cookie setting for csrf would probably be needed if the selfservice also was on different domain? (makes sense)
m
Kratos instance, the app and selfservice would need to be one the same TLD - how is your setup exactly, can you give an example?
w
they are on the same domain, but i wanted to develop on localhost (using http, not https), using remote kratos instance, and sending requests to remote API's that validates cookie against kratos instance. so for instance kratos and selfservice runs on https://id.example.com and i add a
127.0.0.1 <http://myfrontend.example.com|myfrontend.example.com>
entry in
/etc/hosts
then i can visit http://myfrontend.example.com:3000 but cookies wont be sent from http to https, so i needed to set SameSite=None, then it worked.. This is dev instance of everything, so security isnt an issue
i guess the oryproxy cli would also be an alternative
i kinda forgot about that, but probably wanted to see if it was possible without
m
ory proxy/ory tunnel are intended for the managed service, so idk they would work for you. since you self-host why not host kratos locally as well?
w
we have many apis, its nice not having to start them and their databaser locally, just the service you are working on, and the rest of services run remotely
And the services validates cookies against remote kratos
m
Then I would recommend to use the managed service Ory Network, its probably easier than develop your own solution here.