network icon indicating copy to clipboard operation
network copied to clipboard

Data mapping not working when updated from settings

Open thecodeassassin opened this issue 3 years ago • 6 comments

Preflight checklist

Describe the bug

When users sign up with a social the metadata gets applied properly. When they link it later the metadata does not get updated properly.

So it happens on register but not on update settings. I think it's because this PR

https://github.com/ory/kratos/pull/2569

Did not address updating social logins from settings.

Reproducing the bug

  • Create a user with email
  • Link an OIDC method that has a valid mapping in settings

Relevant log output

No response

Relevant configuration

No response

Version

Ory Cloud

On which operating system are you observing this issue?

Ory Network

In which environment are you deploying?

Ory Network

Additional Context

No response

thecodeassassin avatar Oct 28 '22 11:10 thecodeassassin

Thank you for the report! It is true that the JsonNet mapper is not applied on linking credentials. We will need to add a feature to support this use case and also provide means of merging the existing data with the new data!

aeneasr avatar Nov 01 '22 12:11 aeneasr

@aeneasr I hope all is well. Is there any chance this will be picked up soon? It's rather inconvenient for our users seeing as we rely on metadata to assign our users custom roles in Discord.

thecodeassassin avatar Nov 09 '22 12:11 thecodeassassin

@kmherrmann @piotrmsc please take a look regarding priorization.

@thecodeassassin are you already on production?

aeneasr avatar Nov 09 '22 12:11 aeneasr

Thank you very much.

Yes, our solution is already in production.

thecodeassassin avatar Nov 09 '22 12:11 thecodeassassin

@aeneasr is there a workaround? Can we somehow retrieve their OIDC login id? I need their Discord ID for example. This is our mapping file:

https://storage.googleapis.com/bac-gcs-production/7db4d530162115ee985f43d49c6ad725ca92d69a714a0fe0676a878e7eb4b0f283e849675fe3caf1374fab7bdd5dc6660a3e1e8d4e08db1baaa6e1a42e6071b5.jsonnet

is the claims.sub stored somewhere that we can retrieve so I can build a workaround ?

thecodeassassin avatar Nov 09 '22 21:11 thecodeassassin

As far as I can read this, the ID, access, and refresh tokens should be available after linking a provider in the settings flow.

Can you check if this works? https://www.ory.sh/docs/kratos/social-signin/get-tokens

aeneasr avatar Nov 10 '22 13:11 aeneasr