<@U04UQ68083H> how do you add oidc phone number to...
# ory-copilot
a
@chilly-king-10285 how do you add oidc phone number to jsonnet for google, linkedin and apple
b
A message from kapa.ai
Based on the provided knowledge sources, I can offer guidance on adding OIDC phone number to Jsonnet for Google, LinkedIn, and Apple social sign-in providers. However, it's important to note that the information available is limited and doesn't specifically address phone numbers for all these providers. I'll provide the best answer possible with the available information. For all social sign-in providers, including Google, LinkedIn, and Apple, you need to be cautious when handling phone numbers, similar to how you handle email addresses. The general principle is to only use verified information to prevent potential security risks. Here's a general approach you can use for adding phone numbers to your Jsonnet data mapping:
Copy code
jsonnet local claims = {   phone_number_verified: false, } + std.extVar('claims');  {   identity: {     traits: {       // Only include the phone number if it exists and is verified       [if 'phone_number' in claims && claims.phone_number_verified then 'phone_number' else null]: claims.phone_number,     },   }, }
This approach is similar to how emails are handled, as shown in the [Ory documentation on emails and phone numbers](https://www.ory.sh/docs/kratos/social-signin/data-mapping#emails-and-phone-numbers). However, it's crucial to note that: 1. Not all providers return phone numbers by default. 2. The availability and naming of phone number claims may vary between providers. 3. You need to ensure that the provider is configured to return phone number information if available. For Google specifically, you might need to request additional scopes to access the phone number. The [Google configuration example](https://www.ory.sh/docs/kratos/social-signin/google#additional-configuration) doesn't mention phone numbers explicitly, so you may need to consult Google's OAuth documentation for the correct scope. For LinkedIn and Apple, the provided knowledge sources don't contain specific information about phone number claims. Remember to always verify the phone number before using it, just as you would with an email address. This helps prevent potential security vulnerabilities. Lastly, don't forget to encode your Jsonnet snippet with Base64 or host it under a URL accessible to Ory Network when adding it to your configuration, as mentioned in the [LinkedIn configuration guide](https://www.ory.sh/docs/kratos/social-signin/linkedin). If you need more specific information about phone number claims for these providers, you may need to consult their respective OAuth documentation or contact Ory support for more detailed guidance.