cold-scientist-93808
11/25/2024, 9:55 AMbrief-egg-61061
11/25/2024, 9:55 AMbrief-egg-61061
11/25/2024, 9:55 AMjavascript // Inside your consent endpoint oauth2.acceptOAuth2ConsentRequest({ consentChallenge: challenge, acceptOAuth2ConsentRequest: { grant_scope: grantScope, session: { id_token: { // Include metadata here metadata: identity.metadata_public } } } })
This approach allows you to include the public metadata from Kratos in the ID token. The specific implementation may vary depending on your setup and requirements. It's important to note that you should be cautious about what data you include in tokens, especially considering privacy and security implications. For more detailed information on customizing the consent flow, you can refer to the [Ory Hydra Custom Login and Consent Flow documentation](https://www.ory.sh/docs/oauth2-oidc/custom-login-consent/flow#consent-endpoint-code-example). Additionally, you might want to review the [Ory Kratos Identity Metadata documentation](https://www.ory.sh/docs/kratos/manage-identities/managing-users-identities-metadata) to understand what metadata is available and how to use it.