<@U04UQ68083H> how to create a jsonnet file for ad...
# ory-copilot
f
@chilly-king-10285 how to create a jsonnet file for adding kratos as an OIDC provider, can you give an example for simple email password method
c
A message from kapa.ai
To create a Jsonnet file for adding Kratos as an OIDC provider, you need to map the desired claims to the Ory Identity schema. Here's an example for a simple email-password method:
Copy code
jsonnet local claims = std.extVar('claims');   {     identity: {       traits: {         // Allowing unverified email addresses enables account         // enumeration attacks,  if the value is used for         // verification or as a password login identifier.         //         // If connecting only to your organization (one tenant), claims.email is safe to use         // if you haven't actively disabled e-mail verification during sign-up.         //         // The email might be empty if the account isn't linked to an email address.         // For a human readable identifier, consider using the "preferred_username" claim.         [if 'email' in claims then 'email' else null]: claims.email,       },     },   }
This Jsonnet code snippet maps the email claim to the Ory Identity schema. It checks if the 'email' claim exists in the claims and if so, it assigns the email claim to the 'email' field in the identity traits. If the 'email' claim does not exist, it assigns null to the 'email' field. Please note that you should not save secrets such as API keys, credentials, or personal data directly in Jsonnet code snippets. Jsonnet code snippets used for data mapping aren't stored in an encrypted format in Ory Network. For more information, you can refer to the [Ory documentation](https://www.ory.sh/docs/kratos/social-signin/microsoft#data-mapping).