Open dotubutis opened 2 years ago
This is a great question and your analysis is correct. The OIDC data from other social sign in providers are not synched during the account linking flow, they are only set up once during registration. I also definitely understand the use case why this is useful.
One problem here is that a new account linking process should usually not override the existing user's name (as they probably have set it up correctly already) or other data that should be left untouched. One idea could be to pass the existing identity to set.extVar(identity)
.
Thanks for the clarification! Could you elaborate on the suggested idea, not sure how that would work.
I guess something like this:
local claims = {
email_verified: false,
} + std.extVar('claims');
local identity = std.extVar('identity')
{
identity: {
traits: identity.traits
metadata_admin: identity.metadata_admin + {
discord_name: claims.name,
},
},
}
Thanks. If I understand correctly, in the current implementation this is not supposed to work bc, as you said, OIDC provider data is only set up once during the registration.
Is there any approach currently available for fetching OIDC data from social providers during the linking process, not the registration process?
Preflight checklist
Describe the bug
I'm trying to add different
metadata_admin
field mappings from different social sign-in providers. Only the fields provided by the first provider that is linked (by the end-user) persist. Is this expected behaviour, and, if so, is there a workaround?Is there a way to populate fields from other providers, alongside the first one that is linked?
Reproducing the bug
1) User links Github as social login in the self-service UI 2) Then links Discord. 3)
admin/identities/{id}
endpoint returns only metadata fields provided by Github for the given user.If first two steps are reversed, only Discord fields persist.
Relevant log output
Relevant configuration
Version
Latest
On which operating system are you observing this issue?
Ory Cloud
In which environment are you deploying?
Ory Cloud
Additional Context
Github jsonnet mapping
Discord jsonnet mapping