hello, anyone here managed to get email from useri...
# ory-selfhosting
b
hello, anyone here managed to get email from userinfo ory hydra endpoint when using ory kratos as identity provider ? I made sure to set 'openid profile email' scope when registering my oauth2 app and they are present when accepting the consent request during the authorization code flow
I get this response
Copy code
{
  "aud": [
    "1637bde2-54c3-4146-8d30-75a4c8e19b57"
  ],
  "auth_time": 1727172695,
  "iat": 1727174357,
  "iss": "<http://172.17.0.1:4444>",
  "rat": 1727174355,
  "sub": "63141f11-abdd-47d0-94ef-e475670a9968"
}
I should also get email claim as the doc let me think https://www.ory.sh/docs/oauth2-oidc/userinfo-oidc
as I see in https://github.com/ory/hydra/issues/1367#issuecomment-484454387 I should programmatically set custom claims email at the consent stage for id_token ? cf: https://www.ory.sh/docs/oauth2-oidc/userinfo-oidc#adding-custom-claims-to-the-userinfo-response If it is the case, I guess I should check that the requested scopes contains 'openid and email' before adding email value as custom claims in userinfo response