Metadata and trait not update on link with other google account via oidc
HoangViet144 opened this issue · comments
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
Ory Network Project
No response
Describe the bug
When linking with other google account, the trait and metadata are not updated with information from new google account.
My kratos supports both password and oidc.
I register an account using oidc with email A.
Then I set a password for my account
After that, I unlink and link with other email B. But the trait and metadata are not updated with information from email B. In the setting hook, I dont have any info from new link account to update manually using hook
"identity.default.schema.json": |
{
"$id": "https://schemas.ory.sh/presets/kratos/identity.email.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Person",
"type": "object",
"properties": {
"traits": {
"type": "object",
"properties": {
"first_name": {
"type": "string",
"title": "First name",
"maxLength": 256
},
"last_name": {
"type": "string",
"title": "Last name",
"maxLength": 256
},
"email": {
"type": "string",
"format": "email",
"title": "E-Mail",
"maxLength": 256,
"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"
}
}
}
},
"required": [
"first_name",
"last_name",
"email"
],
"additionalProperties": false
},
"metadata_public": {
"type": "object",
"properties": {
"email": {
"type": "string"
}
}
}
}
}
"oidc.google.jsonnet": |
local claims = {
email_verified: false,
} + std.extVar('claims');
{
identity: {
traits: {
first_name: claims.given_name,
last_name: claims.family_name,
[if 'email' in claims && claims.email_verified then 'email' else null]: claims.email,
},
"metadata_public": {
[if 'email' in claims && claims.email_verified then 'email' else null]: claims.email,
}
}
}
Reproducing the bug
My kratos supports both password and oidc.
I register an account using oidc with email A.
Then I set a password for my account
After that, I unlink and link with other email B. But the trait and metadata are not updated with information from email B. In the setting hook, I dont have any info from new link account to update manually using hook
Relevant log output
No response
Relevant configuration
No response
Version
v1.1.0
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
Kubernetes with Helm
Additional Context
No response
Maybe related to: #2898