oauth/SSO: Ory return 400 error message together with a data #132
-
|
During oauth flow when SSO provider return user to the to platform, kratos creates session with a user data from SSO provider. In order to retrieve that data we are doing GET request to kratos Surprisingly, this request returns 400 error together with user data, and error message Maybe we are doing something wrong and we should get user data differently, but based on our research we are doing it correctly. It just seems like kratos should return 200 instead of 400. Can somebody please explain to me logic of using 400 here? Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hello @vladyslav2 This behavior is actually expected in Ory Kratos, though it can be confusing. When you make a GET request to /self-service/registration?flow=, you're using the correct endpoint to retrieve the flow data, but Kratos returns a 400 status code because it's enforcing that certain operations should only be performed with specific HTTP methods. Kratos returns different status codes based on the flow state:
This is a known point of confusion as mentioned in GitHub issue #4052, there are plans to improve this in a future version, see this comment. |
Beta Was this translation helpful? Give feedback.
Hello @vladyslav2
This behavior is actually expected in Ory Kratos, though it can be confusing. When you make a GET request to /self-service/registration?flow=, you're using the correct endpoint to retrieve the flow data, but Kratos returns a 400 status code because it's enforcing that certain operations should only be performed with specific HTTP methods.
Kratos returns different status codes based on the flow state: