I 've modified my identity schema to have username...
# ory-network
f
I 've modified my identity schema to have username + email but i struggle to return the username in the id_token when i connect using and oauth 2.0 OpenID connect endpoint I can get the email by setting a scope of email in the token request ( found it despite not being mentionned in the doc ) but can't get the username. How can i get get the username in id_token -> profile ?
p
Hi @future-doctor-89396 Are you using the Account Experience? The account experience only maps the email afaik. For you to map other scopes you would need to have your own consent screen Take a look at these docs http://ory.sh/docs/hydra/guides/custom-ui-oauth2 http://ory.sh/docs/hydra/concepts/consent
Or wait do you mean you have a social sign in flow from your application and you would like to map the scopes from the third party?
f
no i just want to get the username set on the ory account
Are you using the Account Experience ? yep
will check to make a custom ui auth seems what i need
p
no i just want to get the username set on the ory account
So the registration or login should map a username as well as email? When updating the Identity schema, any existing account will need to be manually migrated since it is linked to the previous identity schema.
Try registering a new account with the new identity schema which has username and password. both fields should be present
if you are setting up SSO (single sign on) with Ory Hydra, then refer to my first message https://ory-community.slack.com/archives/C02MR4DEEGH/p1674742787353079?thread_ts=1674647167.080679&cid=C02MR4DEEGH
f
I already updated a the identity schema to get a username email and password
and yep it's for SSO
👍 1
Thank you 😉
❤️ 1