ory / network

Ory runs a global end-to-end security infrastructure for humans, robots, and servers. We build and use open source software.
Apache License 2.0
81 stars 6 forks source link

Data mapping not working when updated from settings #170

Open thecodeassassin opened 2 years ago

thecodeassassin commented 2 years ago

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

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

aeneasr commented 2 years ago

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!

thecodeassassin commented 2 years ago

@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.

aeneasr commented 2 years ago

@kmherrmann @piotrmsc please take a look regarding priorization.

@thecodeassassin are you already on production?

thecodeassassin commented 2 years ago

Thank you very much.

Yes, our solution is already in production.

thecodeassassin commented 2 years ago

@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 ?

aeneasr commented 2 years ago

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