clean-country-94126
08/20/2022, 9:40 AMtime=2022-08-20T09:23:39Z level=info msg=started handling request http_request=map[headers:map[accept:application/json, text/plain, */* user-agent:axios/0.21.4 x-csrf-token:6mvQVlntqx9jZJDAaaX6Xxlb3RzCeD1sPtQUzRrck2E= x-forwarded-for:172.17.0.1 x-forwarded-host:auth.hangar.test x-forwarded-port:443 x-forwarded-proto:https x-forwarded-scheme:https x-real-ip:172.17.0.1 x-request-id:3a579be8afe2adfe225624dc10f0f869 x-scheme:https] host:auth.hangar.test method:GET path:/self-service/login/flows query:id=472c8afd-5dd0-4659-9fce-d6fece8ef0a2 remote:172.17.0.5:43552 scheme:http]
time=2022-08-20T09:23:39Z level=info msg=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. stack_trace:
<http://github.com/ory/kratos/x.CSRFErrorReason|github.com/ory/kratos/x.CSRFErrorReason>
/project/x/nosurf.go:179
<http://github.com/ory/kratos/selfservice/flow/login.(*Handler).fetchFlow|github.com/ory/kratos/selfservice/flow/login.(*Handler).fetchFlow>
/project/selfservice/flow/login/handler.go:422
I don't even know why I need to add the header, as this is a server call, using the (java) SDK, which just takes the cookie as param, I added the header manually to see if that fixes the error. The docs also don't mention that I would to pass a http header... https://www.ory.sh/docs/kratos/reference/api#operation/getSelfServiceLoginFlowclean-country-94126
08/20/2022, 9:41 AMred-machine-69654
08/20/2022, 1:01 PMred-machine-69654
08/20/2022, 1:01 PMclean-country-94126
08/20/2022, 1:03 PMmethod:GET path:/self-service/login/flows query:id=472c8afd-5dd0-4659-9fce-d6fece8ef0a2clean-country-94126
08/20/2022, 1:04 PMred-machine-69654
08/20/2022, 1:04 PMred-machine-69654
08/20/2022, 1:05 PMclean-country-94126
08/20/2022, 1:05 PMclean-country-94126
08/20/2022, 1:06 PMred-machine-69654
08/20/2022, 1:07 PM?flow is in the URL, I send the client to kratos to get init the flow
⢠when it comes back, it should have ?flow= (and not ?id=)red-machine-69654
08/20/2022, 1:08 PM?flowred-machine-69654
08/20/2022, 1:08 PMfetch() (or use an SDK)clean-country-94126
08/20/2022, 1:08 PMred-machine-69654
08/20/2022, 1:09 PMid ?clean-country-94126
08/20/2022, 1:09 PMred-machine-69654
08/20/2022, 1:09 PMclean-country-94126
08/20/2022, 1:09 PMclean-country-94126
08/20/2022, 1:10 PMid
required
string
The Login Flow ID
The value for this parameter comes fromURL Query parameter sent to your application (e.g.flow)./login?flow=abcde
red-machine-69654
08/20/2022, 1:11 PMclean-country-94126
08/20/2022, 1:11 PMred-machine-69654
08/20/2022, 1:11 PMred-machine-69654
08/20/2022, 1:11 PMred-machine-69654
08/20/2022, 1:12 PMclean-country-94126
08/20/2022, 1:13 PMred-machine-69654
08/20/2022, 1:13 PMclean-country-94126
08/20/2022, 1:13 PMred-machine-69654
08/20/2022, 1:13 PMgetSelfServiceLoginFlow(id)clean-country-94126
08/20/2022, 1:13 PMclean-country-94126
08/20/2022, 1:13 PMred-machine-69654
08/20/2022, 1:13 PMred-machine-69654
08/20/2022, 1:13 PMclean-country-94126
08/20/2022, 1:14 PMclean-country-94126
08/20/2022, 1:14 PMred-machine-69654
08/20/2022, 1:15 PMclean-country-94126
08/20/2022, 1:15 PMred-machine-69654
08/20/2022, 1:16 PMclean-country-94126
08/20/2022, 1:16 PMclean-country-94126
08/20/2022, 1:17 PMclean-country-94126
08/20/2022, 1:18 PMclean-country-94126
08/20/2022, 1:18 PMred-machine-69654
08/20/2022, 1:20 PMred-machine-69654
08/20/2022, 1:22 PMred-machine-69654
08/20/2022, 1:22 PMclean-country-94126
08/20/2022, 1:22 PMred-machine-69654
08/20/2022, 1:24 PMred-machine-69654
08/20/2022, 1:25 PM.test domain has an older cookie still set?red-machine-69654
08/20/2022, 1:25 PMclean-country-94126
08/20/2022, 1:25 PMred-machine-69654
08/20/2022, 1:26 PMclean-country-94126
08/20/2022, 1:29 PMclean-country-94126
08/20/2022, 1:29 PMred-machine-69654
08/20/2022, 1:30 PMred-machine-69654
08/20/2022, 1:30 PMred-machine-69654
08/20/2022, 1:30 PMclean-country-94126
08/20/2022, 1:31 PMclean-country-94126
08/20/2022, 1:32 PMclean-country-94126
08/20/2022, 1:33 PMclient.global.set("cookie_header", response.headers.valuesOf("Set-Cookie")[0].replace("csrf_token_", "csrf_token_2"));
ends in the same errorclean-country-94126
08/20/2022, 1:33 PMred-machine-69654
08/20/2022, 1:36 PMred-machine-69654
08/20/2022, 1:36 PMred-machine-69654
08/20/2022, 1:37 PMred-machine-69654
08/20/2022, 1:37 PMclean-country-94126
08/20/2022, 1:37 PMclean-country-94126
08/20/2022, 1:38 PMclean-country-94126
08/20/2022, 1:38 PMred-machine-69654
08/20/2022, 1:38 PMclean-country-94126
08/20/2022, 1:38 PMclean-country-94126
08/20/2022, 1:39 PMclean-country-94126
08/20/2022, 1:39 PMclean-country-94126
08/20/2022, 1:39 PMclean-country-94126
08/20/2022, 1:56 PMclean-country-94126
08/20/2022, 2:01 PMclean-country-94126
08/20/2022, 2:10 PMhttps://i.imgur.com/lDtBd2k.pngā¾
clean-country-94126
08/20/2022, 2:11 PMclean-country-94126
08/20/2022, 2:14 PMclean-country-94126
08/20/2022, 2:14 PMclean-country-94126
08/20/2022, 2:20 PMclean-country-94126
08/20/2022, 2:23 PMclean-country-94126
08/20/2022, 2:50 PMred-machine-69654
08/20/2022, 3:10 PMred-machine-69654
08/20/2022, 3:10 PMred-machine-69654
08/20/2022, 3:10 PMclean-country-94126
08/20/2022, 3:10 PMred-machine-69654
08/20/2022, 3:11 PMred-machine-69654
08/20/2022, 3:11 PMred-machine-69654
08/20/2022, 3:12 PMclean-country-94126
08/20/2022, 3:12 PMclean-country-94126
08/20/2022, 3:12 PMred-machine-69654
08/20/2022, 3:14 PMclean-country-94126
08/20/2022, 3:19 PM