-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 token request hooks for all grant types #3427
feat: add token request hooks for all grant types #3427
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3427 +/- ##
==========================================
- Coverage 76.83% 76.82% -0.01%
==========================================
Files 123 124 +1
Lines 9125 9160 +35
==========================================
+ Hits 7011 7037 +26
- Misses 1666 1673 +7
- Partials 448 450 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
This looks very good! I just had some minor questions & suggestions.
@hperl I fixed the comments, please have a look! |
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.
Very nice changes, just two minor remarks
@aeneasr I fixed the following parts:
Please have a look. |
Docs are also updated - ory/docs#1241 |
...ion=should_pass_request_if_strategy_passes-should_call_refresh_token_hook_if_configured.json
Outdated
Show resolved
Hide resolved
spec/config.json
Outdated
@@ -975,6 +975,24 @@ | |||
"description": "Sets the refresh token hook endpoint. If set it will be called during token refresh to receive updated token claims.", | |||
"format": "uri", | |||
"examples": ["https://my-example.app/token-refresh-hook"] | |||
}, | |||
"authorization_code_hook": { |
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.
Do we need all of these config elements? Maybe it makes more sense to have one endpoint and pass the grant type and let the webhook deal with that?
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.
Yeah, that makes much more sense. Let me take a stab at it.
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.
Awesome thanks :)
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.
To keep backwards compatibility we could also just add a new key "hook" and deprecate the refresh token hook at some point. That way we don't break BC?
@aeneasr Changed to having a generic |
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.
Very nice
@fehrnah FYI, it's finally in! Thanks for laying the foundation for this feature 👍 |
Congratulations! |
Thank you both :) |
Added a generic token hook that is called for all grant types and includes `payload` with a single allowed value - `assertion` to cover the `jwt-bearer` grant type customization. The existing `refresh token hook` is left unchanged and is considered to be deprecated in favor of the new hook logic. The `refresh token hook` will at some point be removed. Closes ory#3244 Closes ory/fosite#729
Added a generic token hook that is called for all grant types and includes
payload
with a single allowed value -assertion
to cover thejwt-bearer
grant type customization.Existing
refresh hook
is left unchanged and will be deprecated in favor of the new hook.Related issue(s)
#3244
ory/fosite#729
This change completes and extends the work done in #3254
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
security@ory.sh) from the maintainers to push
the changes.
works.
Further Comments
Docs update PR - ory/docs#1241