cold-scientist-93808
10/24/2024, 2:10 PMbrief-egg-61061
10/24/2024, 2:10 PMbrief-egg-61061
10/24/2024, 2:10 PMstd.extVar('claims')
. This allows you to "dump" or use any of the claims received. 3. You can then map these claims to identity traits, or even store them in the identity's metadata. Here's an example of how you might do this: jsonnet local claims = std.extVar('claims'); { identity: { traits: { email: claims.email }, metadata_public: { // Store all claims in public metadata oidc_claims: claims, }, } }
In this example, we're storing all the claims in the metadata_public
field of the identity. This effectively "dumps" all the claims received from the OIDC provider. It's important to note that you should be cautious about which claims you store and where, especially when dealing with sensitive information. The [Ory documentation on setting identity metadata](https://www.ory.sh/docs/kratos/social-signin/data-mapping#set-identity-metadata) provides more information on this topic. Remember that Jsonnet code snippets used for data mapping aren't stored in an encrypted format in Ory Network, so you should avoid storing sensitive information directly in these snippets [Source](https://www.ory.sh/docs/kratos/social-signin/ory#data-mapping).cold-scientist-93808
11/25/2024, 9:57 AM