Skip to content
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

Add token web hook for all grants types #3244

Closed
4 of 6 tasks
fehrnah opened this issue Sep 5, 2022 · 3 comments
Closed
4 of 6 tasks

Add token web hook for all grants types #3244

fehrnah opened this issue Sep 5, 2022 · 3 comments
Labels
feat New feature or request.

Comments

@fehrnah
Copy link
Contributor

fehrnah commented Sep 5, 2022

Preflight checklist

Describe your problem

Currently there exists a web hooks for refresh_token grants, but customizing other grant types is either not possible or not easy.

For example, customizing access_code tokens can be done in the consent endpoint, but customizing client_credentials is not possible.

Describe your ideal solution

Add access_token, jwt_profile and client_credentials web hooks working in a similar way to the existing refresh_token web hook.

Workarounds or alternatives

#1748 Would allow limited customization of all claims, not allowing more dynamic claims.
#1383 Is about setting static claims to client_credential tokens

Version

2.0

Additional Context

I was unsure if this was big enough to need a design document, If it does, pleas close this issue and I will remake it with a design document.

@fehrnah fehrnah added the feat New feature or request. label Sep 5, 2022
@synclpz
Copy link

synclpz commented Sep 6, 2022

I have some demand for on-the-fly scope/audience check due to API consumer might have changed it's subscriptions on the API portal which has different client (consumer) lifecycle than Hydra has. Also inserting some API-GW related consumer ID should make call control easier on GW side. This is still not possible using client_credentials flow with Hydra.

@aeneasr
Copy link
Member

aeneasr commented Sep 9, 2022

Yeah, I think this is a pretty good idea

@fehrnah
Copy link
Contributor Author

fehrnah commented Sep 9, 2022

Great, I'm already working on it, I still have some tests to run and I should be able to create a PR soon.

harnash pushed a commit to Wikia/ory-hydra that referenced this issue Apr 12, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request.
Projects
None yet
Development

No branches or pull requests

3 participants