billowy-magician-58884
08/07/2025, 2:08 PMbrief-egg-61061
08/07/2025, 2:08 PMbrief-egg-61061
08/07/2025, 2:09 PMphone_number
claim in the OIDC /userinfo
API call, you need to ensure the following: 1. Identity Schema Includes Phone Number: Your identity schema must define a phone
(or phone_number
) trait. For example: json { "traits": { "phone": { "title": "Phone", "type": "string", "format": "tel", "<http://ory.sh/kratos|ory.sh/kratos>": { "credentials": { "password": { "identifier": true } } } } } }
This allows users to have a phone number as part of their identity and optionally use it as a login identifier. The "format": "tel"
enables validation of phone numbers in E.164 format, as recommended by OIDC specs [Customize identity schemas - Phone number](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#phone-number). 2. Scope Must Include profile
: The OIDC profile
scope is what typically enables the return of standard profile claims, including phone_number
, if present in the user's traits [Customize OpenID Connect scope and claims](https://www.ory.sh/docs/oauth2-oidc/openid-connect-claims-scope-custom). 3. User's Phone Number Must Be Set and (Optionally) Verified: The phone number must be present in the user's identity. If you want to return phone_number_verified
, the phone number should be verified through Ory's verification flows. 4. Userinfo Endpoint Returns Claims from Identity: The /userinfo
endpoint returns claims based on the user's identity and the scopes requested. If the phone number is present and the correct scope is requested, it will be included in the response. The Ory API reference lists phone_number
and phone_number_verified
as standard claims in the userinfo response [Ory API Reference - getOidcUserInfo](https://raw.githubusercontent.com/ory/docs/master/docs/reference/api.json). Summary of Steps: - Add phone
to your identity schema. - Ensure users have a phone number set (and verified, if needed). - Request the profile
scope in your OIDC flow. - Call the /userinfo
endpoint with a valid access token. If all these are set up, Ory Network will include the phone_number
(and phone_number_verified
, if applicable) in the /userinfo
response. > Note: If you have customized claims or need to map a different trait name, you may need to adjust your schema or use custom claim mapping as described in the Ory documentation. If you need to map a custom trait (e.g., traits.phone
) to the OIDC phone_number
claim, you may need to use Ory's custom claims mapping features, but the knowledge sources do not provide explicit step-by-step instructions for this scenario.billowy-magician-58884
08/07/2025, 2:13 PMbrief-egg-61061
08/07/2025, 2:14 PMbrief-egg-61061
08/07/2025, 2:14 PMbillowy-magician-58884
08/07/2025, 3:36 PMbrief-egg-61061
08/07/2025, 3:36 PMbrief-egg-61061
08/07/2025, 3:36 PMbillowy-magician-58884
08/07/2025, 3:42 PMbrief-egg-61061
08/07/2025, 3:43 PMbrief-egg-61061
08/07/2025, 3:43 PMjson "organizations": { "matcher": "email_domain" }
There is no explicit documentation or example in the sources that explains what this field does or how it is used within Ory's identity schema or organization management features. If this is from a custom implementation or a feature not covered in the official documentation, I recommend reaching out to the Ory team or consulting the latest official documentation for clarification.