-
Notifications
You must be signed in to change notification settings - Fork 977
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
feat: add upstream parameters to oidc provider #3138
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3138 +/- ##
==========================================
- Coverage 77.58% 77.55% -0.03%
==========================================
Files 316 316
Lines 19906 19924 +18
==========================================
+ Hits 15444 15452 +8
- Misses 3273 3279 +6
- Partials 1189 1193 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
aecb88b
to
e35db60
Compare
For the E2E tests to pass here we need to merge ory/kratos-selfservice-ui-react-nextjs#54 first. |
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.
LGTM.
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.
Nice work. Only some minor things.
1895fd1
1895fd1
to
8fe11cd
Compare
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.
Nicely done, I have a some comments :)
// validation of sent providers are already handled in the `oidc/.schema/link.schema.json` file. | ||
// `upstreamParameters` will always only contain allowed parameters based on the configuration. |
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'd prefer this to be more explicit, because the input source probably is validated against the form payload, but it might not be in a certain case (e.g. the flow is resumed or something). By putting the validation in the central place where the code is executed, the input source no longer matters because the validation is "deeply embedded" into the flow, and not on the "surface".
The tests cover this nicely already, but for example they don't cover the account settings flow. So here we would have uncertainty whether this validation actually is implemented / working.
Generally speaking, security validation should always be very very explicit and treated like "do you actually have this permission and do I have 100% certainty?".
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 believe this should now be addressed. I have added the upstream parameters to Settings flow as well. I am also double checking the parameters inside the UpstreamParameters
function.
@Benehiko can you please add this to the google social sign in documentation? |
This PR introduces the upstream OIDC query parameters
login_hint
andhd
. More can be added at a later stage in thelink.schema.json
andsettings.schema.json
file.kratos/selfservice/strategy/oidc/.schema/link.schema.json
Lines 20 to 31 in 8fe11cd
https://github.com/ory/kratos/blob/4362423c3cddd98e46745493288fec69f9c66766/selfservice/strategy/oidc/.schema/settings.schema.json
To send additional upstream parameters the form can post this on a login, registration or settings link submit.
For example the form below does an OIDC flow to Google. We can now add additional parameters such as
login_hint
andhd
to the upstream request to Google login with a pre-filled email[email protected]
:Related issue(s)
#3127
#2069
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