-
-
Notifications
You must be signed in to change notification settings - Fork 964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: oidc
does not require a method in the payload
#3564
Conversation
Could we not just require the OIDC method to skip execution if |
So the problem here is that the OIDC method doesn't check the payload for the In an edge case, some users might be sending us a payload containing a method and the provider value. e.g. {
"method": "password",
"password": "1234",
"traits.email": "[email protected]",
"provider": "google"
} In the past the In this PR I address the following:
TL;DR I have added the |
c582928
to
b6873c6
Compare
Codecov Report
@@ Coverage Diff @@
## master #3564 +/- ##
==========================================
+ Coverage 78.13% 78.15% +0.01%
==========================================
Files 341 341
Lines 22923 22939 +16
==========================================
+ Hits 17912 17927 +15
- Misses 3664 3667 +3
+ Partials 1347 1345 -2
|
Thank you! I contextualized the things you correctly identified:
Correct, the reason for this is how HTML forms work. Basically, the form looks like this:
So when the user clicks on the submit button, the form will submit the form with
Agreed, forcing the need for
Paraphrasing: In this scenario the user expects that we use the password method because "method" is the deciding discriminator for action. I think that makes sense!
I think this is the correct solution :) Will review now again! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the correct solution, I just have a two comments on the log messages and deprecation notice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see, now I finally understand why we had this weird behavior in the first place.
The
oidc
strategy does not validate themethod
set in the payload on registration or login.This recently caused issues with custom UIs sending data to Kratos which do not contain
method: oidc
or contains a different method e.gmethod: password
but with aprovider: X
set.This produced unexpected behavior in Kratos, which returns a status code
422
and attempts to redirect the user to the google sign in flow, even though the registration was a POST request with themethod: password
.Since the regression has been in the code a while, this PR does not attempt to fix the issue directly, but rather includes tracing and proper fallback handling to users that actually do include a
method: X
in the POST payload.For example:
method: password
and traits andprovider: google
provider
was specified and that the method was something other thanoidc
.This PR does not fix requiring the
method: oidc
to be set for an OIDC flow, due to the regression existing for so long. Theoidc
regression happened in this commit from 2021 and will thus be phased out gradually.f5091fa
Related issue(s)
Checklist
introduces a new feature.
contributing code guidelines.
vulnerability. If this pull request addresses a security vulnerability, I
confirm that I got the approval (please contact
[email protected]) from the maintainers to push
the changes.
works.
Further Comments