Hello Team, please check below ...
# ory-network
s
Hello Team, please check below for reference ,the problem is when I query for http://somedomain/userinfo the response I'm getting is as follows and there's no email in it
{
"amr": [
"oidc"
],
"aud": [
"ce7fd896-ee73-4785-b5f1-4aebfdc1a1c9"
],
"auth_time": 1637735144,
"iat": 1618069753,
"iss": "<https://somedomain.com>",
"rat": 1738069749,
"sub": "7e4de2r7-c700-4c7f-be34-3b5d02tay116"
}
Copy code
the custom  identity schema template  is 
{
  "$id": "<https://schemas.ory.sh/presets/kratos/identity.blank.schema.json>",
  "title": "SSO-V10",
  "type": "object",
  "properties": {
    "traits": {
      "type": "object",
      "properties": {
        "email": {
          "title": "Email",
          "type": "string",
          "format": "email",
          "ory.sh/kratos": {
            "credentials": {
              "password": {
                "identifier": true
              }
            }
          }
        },
        "first_name": {
          "title": "First Name",
          "type": "string"
        },
        "last_name": {
          "title": "Last Name",
          "type": "string"
        },
        "phone_no": {
          "type": "number",
          "title": "Phone number"
        },
        "country_code": {
          "type": "string",
          "title": "Country Code"
        },
        "company": {
          "type": "object",
          "properties": {
            "company_name": {
              "type": "string",
              "title": "Company Name"
            },
            "company_address": {
              "type": "object",
              "properties": {
                "address_line_1": {
                  "type": "string",
                  "title": "Address Line 1"
                },
                "address_line_2": {
                  "type": "string",
                  "title": "Address Line 2"
                },
                "city": {
                  "type": "string",
                  "title": "City"
                },
                "state": {
                  "type": "string",
                  "title": "State/Province"
                },
                "country": {
                  "type": "string",
                  "title": "Country"
                },
                "zip_code": {
                  "type": "string",
                  "title": "Zip Code"
                }
              },
              "required": []
            }
          },
          "required": []
        }
      },
      "required": [
        "email"
      ],
      "additionalProperties": true
    }
  },
  "$schema": "<http://json-schema.org/draft-07/schema#>"
}
,I'm using SSO provider as google OIDC
Data Mapping:
local claims = {
email_verified: true,
} + std.extVar('claims');
{
identity: {
traits: {
-- Check if email exists and if it's verified, then map it to 'email'
email: if 'email' in claims && claims.email_verified then claims.email else null,
-- Map other claims as required
first_name: claims.given_name,
last_name: claims.family_name,
},
},
}
scopes:
email ,openid,profile
g
you need to provide more information about how you are generating the jwt claims you show. What are you querying? kratos? hydra? i know kratos has a session to jwt mapper. so also does hydra so you need to provide more information
email is not a standard claim and should be included for hydra like this and for kratos jwt like this
s
so the proble I found out is due to verified_adresses not being present and updated it's annoying for me to run an api after every signup and signin called
curl --request PUT -sL \
--header "Authorization: Bearer ory_pat_your_project_api_token" \
--header "Content-Type: application/json" \
--data '{
"schema_id": "<preset://email>",
"traits": {
"email": "<mailto:user@example.com|user@example.com>"
},
"verifiable_addresses": [
{
"value": "<mailto:user@example.com|user@example.com>",
"verified": true,
"via": "email",
"status": "completed"
}
]
}' <https://your_project_slug.projects.oryapis.com/admin/identities>
,do we have any way to skip this and directly verify it and keep email_verififed:true or verified_addresses parametr validate so that oidc reponds email in it's response body