dazzling-evening-45699
02/17/2022, 2:24 PMcrsf
and not csrf
? Are they both same?tall-angle-41306
05/16/2022, 10:35 AM/login?flow=X
(302) and /self-service/login/browser
(303)
Kratos has the error of;
An error occurred while handling a request audience=application error=map[debug: details:map[docs:<https://www.ory.sh/kratos/docs/debug/csrf> hint:The anti-CSRF cookie was found but the CSRF token was not included in the HTTP request body (csrf_token) nor in the HTTP Header (X-CSRF-Token). reject_reason:The HTTP Cookie Header was set and a CSRF token was sent but they do not match. We recommend deleting all cookies for this domain and retrying the flow.] message:the request was rejected to protect you from Cross-Site-Request-Forgery reason:Please retry the flow and optionally clear your cookies. The request was rejected to protect you from Cross-Site-Request-Forgery (CSRF) which could cause account takeover, leaking personal information, and other serious security issues.
The cookie header does get passed in kratos.getSelfServiceLoginFlow(flow, req.header('cookie'))
We also have set the appropriate config
session:
cookie:
domain: <http://myproduct.com|myproduct.com>
Our setup does use subdomains, to rule that out I replaced all that to put everything under one subdomain with unique paths (<http://domain.com/dashboard|domain.com/dashboard>
<http://domain.com/kratos|domain.com/kratos>
etc)
Our auth code isn't to dissimilar (and mostly copied to get something working) from https://github.com/ory/kratos-selfservice-ui-node
Any pointers on what else we can look at to help troubleshooting? @magnificent-energy-493fancy-napkin-38843
09/09/2022, 7:28 AMConfiguration({
baseOptions: {
withCredentials: true,
}
}))
And this is our logout call to Kratos:
new V0alpha2Api(...).submitSelfServiceLogoutFlowWithoutBrowser({ session_token: session ? session.session_token : '' }))
We are using NextJS. Do you have any idea what could be the problem? Thank you!magnificent-energy-493
04/03/2023, 1:23 PM