microscopic-answer-24504
12/07/2023, 7:06 AMbland-eye-99092
12/08/2023, 3:10 PMtoSession
in our sdk). That endpoint has a parameter called „`tokenizeAs`“ which can be used to convert the session to a JWT. The docs for that are here: https://www.ory.sh/docs/identities/session-to-jwt-corspurple-boots-5453
12/10/2023, 9:40 PM{
"$id": "<https://schemas.ory.sh/presets/kratos/identity.email.schema.json>",
"title": "Person",
"type": "object",
"properties": {
"traits": {
"type": "object",
"properties": {
"email": {
"type": "string",
"format": "email",
"title": "E-Mail",
"<http://ory.sh/kratos|ory.sh/kratos>": {
"credentials": {
"password": {
"identifier": true
},
"webauthn": {
"identifier": true
},
"totp": {
"account_name": true
},
"code": {
"identifier": true,
"via": "email"
}
},
"recovery": {
"via": "email"
},
"verification": {
"via": "email"
}
},
"maxLength": 320
}
},
"required": [
"email"
],
"additionalProperties": false
}
}
}
uuid for the flow that failed is b75375d4-eb8b-4d8a-b3d8-3b5a7f9bc786
and 2701aa5e-4176-419f-b4b4-71824354bba4
. I also tried a standard gmail account and had similar issues fa8a524e-2065-4d51-883c-0c7e605842fb
purple-boots-5453
12/11/2023, 6:13 AMbland-eye-99092
12/11/2023, 1:25 PMadditionalProperties \"first_name\", \"hd\", \"last_name\" not allowed"
. This means, that after Ory processed the response from Google, the returning object contained these properties, which did not conform to your identity schema.
To fix this, you can replace the Jsonnet snippet in your OIDC provider configuration with this (go to “Authentication” -> “Social Sign-in” -> Edit your Google Provider -> “Show Advanced Settings” in the Ory Console):
local claims = {
email_verified: true,
} + std.extVar('claims');
{
identity: {
traits: {
[if 'email' in claims && claims.email_verified then 'email' else null]: claims.email,
},
},
}
This will essentially only return the email address from the google account that’s logging in.
If you want to collect other data, such as first name or last name, you can adjust the snippet to also return them (e.g. keep it as the default), but then you’ll also need to add the fields to the identity schema. This docs page should give some more context. Feel free to ping me, if anything is unclear, though. 🙂purple-boots-5453
12/11/2023, 11:05 PMbland-eye-99092
12/12/2023, 8:38 AMpurple-boots-5453
12/12/2023, 9:11 PM