-
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
Email claim not present on ID token after issuing with refresh and webhook enabled #3879
Comments
I can “keep the email claim alive” if I extract it from the request and add it as part of the response of the webhook. Hence if I change the handler to
Then my ID token keep the |
Correct, you need to send the full payload in your webhook response. Maybe this needs to be clarified in the docs - https://www.ory.sh/docs/hydra/guides/claims-at-refresh#responding-to-the-webhook PRs welcomed |
Preflight checklist
Ory Network Project
No response
Describe the bug
Describe the bug
Issue Summary
The ID token lacks the email claim when issued using a refresh token, despite having a configured webhook as described in the Ory Hydra documentation.
This issue was initially reported in issue #3852, which was subsequently closed. However, further investigation has allowed us to isolate the problem with more precision.
Reproducing the bug
Generate a new Ory environment.
Create a OAuth2 client with scopes
openid
,offline_access
andemail
.Validate works without webhook
Using ex. Postman go through a OIDC flow and validate what ID token has email claim.
Also validate, that ID token after issuing with refresh token, has email claim.
Enable webhook and see email claim disappear
Generate a minimal client which can be used as webhook. Example
Create a local tunnel ex. by using ngrok.
Enable webhook following documentation https://www.ory.sh/docs/hydra/guides/claims-at-refresh#webhook-payload
Again do a OIDC flow (using ex. Postman). First time token endpoint is called after login, we receive
and ID token has email claim
first time we call token endpoint with refresh token we correctly in webhook get
but ID token is missing email claim.
Now second time we refresh token and print request in webhook,
ext
is missingand still no email claim on ID token.
I tried to look into the code, and it may seems like the response body is overwriting ID token extra claim. We however send a empty response back. Could this be the issue?
hydra/oauth2/token_hook.go
Line 149 in 0ce9d7a
Relevant log output
No response
Relevant configuration
No response
Version
Ory hosted
On which operating system are you observing this issue?
None
In which environment are you deploying?
None
Additional Context
No response
The text was updated successfully, but these errors were encountered: