rhythmic-musician-58953
09/27/2022, 9:29 PMmetadata_admin
field mappings from different social sign-in providers. Only the fields provided by the first provider that is linked (by the user) persist. Is this expected behaviour, and, if so, is there a workaround?
For example, user first links Github as social login; then links Discord. admin/identities/{id}
GET endpoint returns only metadata fields defined in the Github jsonnet mapping.
Is there a way to populate fields from other providers, alongside the first one that is linked?magnificent-energy-493
rhythmic-musician-58953
09/28/2022, 12:42 AMlocal claims = {
email_verified: false,
} + std.extVar('claims');
{
identity: {
traits: {
[if 'email' in claims && claims.email_verified then 'email' else null]: claims.email,
},
metadata_admin: {
discord_name: claims.name
},
},
}
local claims = {
email_verified: false,
} + std.extVar('claims');
{
identity: {
traits: {
[if 'email' in claims && claims.email_verified then 'email' else null]: claims.email,
},
metadata_admin: {
github_profile_url: claims.profile,
github_avatar_url: claims.picture
},
},
}
magnificent-energy-493
metadata_admin: {
discord_name: string,
github_profile_url: string,
github_avatar_url: string
},
?rhythmic-musician-58953
09/28/2022, 1:40 PMrhythmic-musician-58953
09/28/2022, 2:34 PMadmin/identities/{id}
GET request for reference
{
"$id": "<https://schemas.ory.sh/presets/kratos/identity.email.schema.json>",
"title": "Person",
"type": "object",
"properties": {
"traits": {
...
},
"metadata_admin": {
"type": "object",
"properties": {
"discord_name": {
"type": "string"
},
"github_profile_url": {
"type": "string"
},
"github_avatar_url": {
"type": "string"
}
}
}
}
}
After linking github first:
{
"id": "e4477736-7129-487c-a737-984a3552b8ea",
"credentials": {
"oidc": {
"type": "oidc",
"identifiers": [
"discord:927034984890523760",
"github:33428886"
],
"version": 0,
"created_at": "2022-09-28T14:28:09.934526Z",
"updated_at": "2022-09-28T14:28:50.394822Z"
},
"password": {
...
},
"webauthn": {
...
}
},
"schema_id": "f17ab650e6caa0b4210e08c9b057fcbf9bc30f3ed270dea04e3048ada6295f746141bf1ce1ed60b633c874db2ea0e65a1524575a00fb579ef0c3f156587ffbb3",
"schema_url": "<https://crazy-pascal-3unvbwebpl.projects.oryapis.com/schemas/ZjE3YWI2NTBlNmNhYTBiNDIxMGUwOGM5YjA1N2ZjYmY5YmMzMGYzZWQyNzBkZWEwNGUzMDQ4YWRhNjI5NWY3NDYxNDFiZjFjZTFlZDYwYjYzM2M4NzRkYjJlYTBlNjVhMTUyNDU3NWEwMGZiNTc5ZWYwYzNmMTU2NTg3ZmZiYjM>",
"state": "active",
"state_changed_at": "2022-09-28T14:28:09.813677Z",
"traits": {
...
},
"verifiable_addresses": [
{
...
}
],
"recovery_addresses": [
...
],
"metadata_public": null,
"metadata_admin": {
"github_avatar_url": "<https://avatars.githubusercontent.com/u/33428886?v=4>",
"github_profile_url": "<https://github.com/dotubutis>"
},
"created_at": "2022-09-28T14:28:09.837233Z",
"updated_at": "2022-09-28T14:28:09.837233Z"
}
magnificent-energy-493
rhythmic-musician-58953
10/18/2022, 9:09 PM