Skip to content

Commit d1d47cd

Browse files
jonas-jonasaeneasr
andauthored
docs: document ITP quirks (#2128)
Co-authored-by: aeneasr <[email protected]>
1 parent c898840 commit d1d47cd

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

docs/kratos/debug/troubleshooting.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ title: General troubleshooting
66
:::info
77

88
Please add your troubleshooting tricks and other tips to this document, You can either open a
9-
[discussion](https://github.com/ory/kratos/discussions) and ping `@ory/documenters` or
9+
[discussion](https://github.com/ory/kratos/discussions) or
1010
[edit the page directly](https://github.com/ory/docs/edit/master/docs/kratos/debug/troubleshooting.md).
1111

1212
:::
1313

1414
### `400: Bad Request` on self-service flows
1515

1616
Make sure you are starting and finishing the request in one browser. Self-service browser flows need to be executed in the same
17-
browser from start to finish!
18-
Starting the flow in Safari and completing it in Chrome won't work. API Clients like Electron, Postman or Insomnia are browsers
19-
themselves, which can cause requests to fail. For testing purposes [cURL](https://curl.se/) is a good choice.
17+
browser from start to finish! Starting the flow in Safari and completing it in Chrome won't work. API Clients like Electron,
18+
Postman or Insomnia are browsers themselves, which can cause requests to fail. For testing purposes [cURL](https://curl.se/) is a
19+
good choice.
2020

2121
### How can I separate customers/employee data, but have them use the same login dialog
2222

@@ -37,3 +37,23 @@ instances are cheap to deploy and the databases are isolated from each other. Fo
3737
3838
An alternative to callback and custom code is fronting the legacy system with Ory OAuth2 & OpenID Connect (Ory Hydra) and then
3939
using that as an upstream in Ory Identities (Ory Kratos).
40+
41+
### Safari ITP limits cookies to 7 days
42+
43+
Safari's Intelligent Tracking Prevention (ITP) limits cookies to 7 days. If you set a cookie with a longer lifespan, Safari
44+
ignores the configured duration and expires the cookie after 7 days. This behavior can affect Ory Identities, because the cookies
45+
used for authentication and session management may expire sooner than expected.
46+
47+
This happens when an AJAX request is made from a URL that does not match the custom domain you configured for Ory.
48+
49+
For example, if your login UI runs on `ui.example.com`, Ory is available at `ory.example.com` via a CNAME, and you use AJAX to
50+
submit the login form, Safari ITP will limit the cookie lifespan to 7 days.
51+
52+
To resolve this issue, you can either:
53+
54+
1. Use Cloudflare for the domain that makes the AJAX request to Ory. This makes Ory and your domain appear as the same party to
55+
Safari.
56+
2. Change the form submission from AJAX to a normal form submission. Safari does not apply ITP restrictions to top-level
57+
navigations.
58+
59+
Read more about CNAME cloaking: https://www.cookiestatus.com/safari/#cname-cloaking

0 commit comments

Comments
 (0)