Email claim not present on ID token after issuing with refresh and webhook enabled #3879
Open
5 tasks done
Labels
bug
Something is not working.
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: