Login POST request
url http://127.0.0.1:4455/.ory/kratos/public/self-service/browser/flows/login/strategies/password?request=6d1de2ba-7103-49df-8989-e234ad8fbd50
Request headers
POST /.ory/kratos/public/self-service/browser/flows/login/strategies/password?request=6d1de2ba-7103-49df-8989-e234ad8fbd50 HTTP/1.1
Host: 127.0.0.1:4455
Connection: keep-alive
Content-Length: 160
Pragma: no-cache
Cache-Control: no-cache
sec-ch-ua: "Google Chrome 81"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36
Content-Type: text/plain;charset=UTF-8
Accept: */*
Origin: http://127.0.0.1:3000
Sec-Fetch-Site: same-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: http://127.0.0.1:3000/auth/login?request=6d1de2ba-7103-49df-8989-e234ad8fbd50
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,pt-PT;q=0.8,pt;q=0.7
Cookie: csrf_token=Ln8AQwbz6PVkObzKCPfwuuKHME4y97qDtZZdl/3It/c=
Request body
{
"identifier": "[email protected]",
"password": "123",
"csrf_token": "ChRBFIvtBJkSh78hNPfO8BeNWQdRqVR4VT4JgyDsHPQka0FXjR7sbHa+A+s8AD5K9QppSWNe7vvgqFQU3SSrAw=="
}
Response headers
HTTP/1.1 400 Bad Request
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: http://127.0.0.1:3000
Access-Control-Expose-Headers: Content-Type
Content-Length: 161
Content-Type: application/json
Date: Sun, 03 May 2020 10:56:16 GMT
Vary: Origin
Vary: Cookie
Response body
{
"error": {
"code": 400,
"status": "Bad Request",
"reason": "CSRF token is missing or invalid.",
"message": "The request was malformed or contained invalid parameters"
}
}
Kratos&oathkeeper logs
oathkeeper_1 | [cors] 2020/05/03 11:00:56 Handler: Actual request
oathkeeper_1 | [cors] 2020/05/03 11:00:56 Actual response added headers: map[Access-Control-Allow-Credentials:[true] Access-Control-Allow-Origin:[http://127.0.0.1:3000] Access-Control-Expose-Headers:[Content-Type] Vary:[Origin]]
oathkeeper_1 | {"level":"info","method":"POST","msg":"started handling request","remote":"172.18.0.1:40962","request":"/.ory/kratos/public/self-service/browser/flows/login/strategies/password?request=6d1de2ba-7103-49df-8989-e234ad8fbd50","time":"2020-05-03T11:00:56Z"}
kratos_1 | time="2020-05-03T11:00:56Z" level=info msg="started handling request" method=POST name="public#http://127.0.0.1:4455/.ory/kratos/public/" remote="172.18.0.5:42396" request="/self-service/browser/flows/login/strategies/password?request=6d1de2ba-7103-49df-8989-e234ad8fbd50"
kratos_1 | time="2020-05-03T11:00:56Z" level=warning msg="A request failed due to a missing or invalid csrf_token value" expected_token="PRu1rH74OP8QBzM4Z/UaOhxBMZlNRBetM569LFLitcoTZLXveAvQCnQ+j/JvAuqA/sYB13+zrS6GCOC7ryoCPQ==" received_token= received_token_form=
oathkeeper_1 | {"granted":true,"http_host":"127.0.0.1:4455","http_method":"POST","http_url":"http://kratos:4433/self-service/browser/flows/login/strategies/password?request=6d1de2ba-7103-49df-8989-e234ad8fbd50","http_user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36","level":"warning","msg":"Access request granted","subject":"","time":"2020-05-03T11:00:56Z"}
kratos_1 | time="2020-05-03T11:00:56Z" level=error msg="An error occurred while handling a request" code=400 debug= details="map[]" error="The request was malformed or contained invalid parameters" reason="CSRF token is missing or invalid." request-id= status=400 trace="Stack trace: \ngithub.com/ory/kratos/x.NewCSRFHandler.func1\n\t/home/ory/x/nosurf.go:64\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2007\ngithub.com/justinas/nosurf.(*CSRFHandler).handleFailure\n\t/go/pkg/mod/github.com/justinas/[email protected]/handler.go:193\ngithub.com/justinas/nosurf.(*CSRFHandler).ServeHTTP\n\t/go/pkg/mod/github.com/justinas/[email protected]/handler.go:175\ngithub.com/urfave/negroni.Wrap.func1\n\t/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:46\ngithub.com/urfave/negroni.HandlerFunc.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:29\ngithub.com/urfave/negroni.middleware.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:38\ngithub.com/ory/x/metricsx.(*Service).ServeHTTP\n\t/go/pkg/mod/github.com/ory/[email protected]/metricsx/middleware.go:261\ngithub.com/urfave/negroni.middleware.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:38\ngithub.com/ory/x/reqlog.(*Middleware).ServeHTTP\n\t/go/pkg/mod/github.com/ory/[email protected]/reqlog/middleware.go:140\ngithub.com/urfave/negroni.middleware.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:38\ngithub.com/urfave/negroni.(*Negroni).ServeHTTP\n\t/go/pkg/mod/github.com/urfave/[email protected]/negroni.go:96\ngithub.com/gorilla/context.ClearHandler.func1\n\t/go/pkg/mod/github.com/gorilla/[email protected]/context.go:141\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2007\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2802\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1890\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1357" writer=JSON
kratos_1 | time="2020-05-03T11:00:56Z" level=info msg="completed handling request" method=POST name="public#http://127.0.0.1:4455/.ory/kratos/public/" remote="172.18.0.5:42396" request="/self-service/browser/flows/login/strategies/password?request=6d1de2ba-7103-49df-8989-e234ad8fbd50" status=400 text_status="Bad Request" took="794.1µs"
oathkeeper_1 | {"level":"info","measure#oathkeeper-proxy.latency":5571600,"method":"POST","msg":"completed handling request","remote":"172.18.0.1:40962","request":"/.ory/kratos/public/self-service/browser/flows/login/strategies/password?request=6d1de2ba-7103-49df-8989-e234ad8fbd50","status":400,"text_status":"Bad Request","time":"2020-05-03T11:00:56Z","took":5571600}