Hi there, I have been using Kratos for quite a while and it was all working properly.
But today after I upgraded it from 0.4.6 to 0.5.3, the CSRF problem just shows up. Kratos complaints about missing CSRF for all flows. And the issue seems to be periodic: for a short period of time it doesn’t work, and then it works after a while. So it’s very hard for me to reproduce this.
I am aware that there is this doc exist. I have double checked that non of those items applies to me.
I am just wondering if there is any breaking changes relating to CSRF handling between these two versions that is not mentioned in the CHANGELOG?
Thanks a lot.
More tech detail, when it’s breaking
I tried:
http '${KRATOS_ADMIN}/self-service/login/flows?id=${FLOW_ID}'
and then I grabbed the return CSRF token and passed in:
http --form POST ${KRATOS_PUBLIC}/self-service/login/methods/password?flow=${FLOW_ID} \
csrf_token='THE ABOVE CSRF' \
identifier='random' \
password='random' \
Host:'127.0.0.1:3001' # this is to simulate browser header
It redirects me to the error flow with following log in Kratos:
time=2020-10-31T06:05:15Z level=info msg=Encountered self-service login error. audience=audit error=map[debug: message:The requested action was forbidden reason:A request failed due to a missing or invalid csrf_token value. status:Forbidden status_code:403] ......