worried-helmet-5462
09/06/2024, 4:32 AMchilly-king-10285
09/06/2024, 4:32 AMchilly-king-10285
09/06/2024, 4:32 AMlocalhost
domain. Ory APIs must be available on the same domain as your application to avoid issues with third-party cookies. The easiest way to expose Ory on your localhost
domain is to use the Ory CLI Tunnel. You can start the Ory Tunnel using the command `ory tunnel --dev --project $PROJECT_SLUG http://localhost:3000`[^1^]. However, there are some limitations when using the Ory Tunnel. For instance, cookies set on localhost
will not be sent in requests to 127.0.0.1
and vice versa[^4^]. Also, it's important to note that iframes can pose a significant security risk for authentication services. Safari has implemented a feature called Intelligent Tracking Prevention that blocks third-party cookies by default in iframe contexts, which breaks authentication, CSRF-prevention, and sessions[^5^]. To debug issues related to cookies or anti-CSRF defenses, you can use tools like the Chrome DevTools[^2^]. If you're using Ory Kratos, it provides CSRF protection for all flows. This means that you must send a CSRF token in the body and CSRF cookie back when submitting a flow[^3^]. [^1^]: (https://www.ory.sh/docs/getting-started/local-development#local-development) [^2^]: (https://www.ory.sh/docs/troubleshooting/csrf) [^3^]: (https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration#cross-site-request-forgery-errors) [^4^]: (https://www.ory.sh/docs/getting-started/local-development#limitations) [^5^]: (https://www.ory.sh/docs/troubleshooting/iframes)worried-helmet-5462
09/06/2024, 4:33 AMchilly-king-10285
09/06/2024, 4:33 AMchilly-king-10285
09/06/2024, 4:33 AM