ory / kratos

The most scalable and customizable identity server on the market. Replace your Homegrown, Auth0, Okta, Firebase with better UX and DX. Has all the tablestakes: Passkeys, Social Sign In, Multi-Factor Auth, SMS, SAML, TOTP, and more. Written in Go, cloud native, headless, API-first. Available as a service on Ory Network and for self-hosters.
https://www.ory.sh/?utm_source=github&utm_medium=banner&utm_campaign=kratos
Apache License 2.0
11.14k stars 955 forks source link

Refresh identity traits on social / SSO login #2898

Open aeneasr opened 1 year ago

aeneasr commented 1 year ago

Preflight checklist

Describe your problem

Currently, social sign in only executes the JsonNet during registration. However, multiple questions have come up in several issues how this can be solved for linking sign ins, or when the user sign ins again - to keep the data fresh.

Example of such a discussion: https://github.com/ory/network/issues/164#issuecomment-1285989251 (there are more!)

Describe your ideal solution

The jsonnet should be executed on sign in and on linking social sign in as well. It will have to respect the existing user data as well (so it needs to be available in the context).

Workarounds or alternatives

There are no workarounds for this.

Version

master

Additional Context

No response

netthier commented 1 year ago

Already posted this in one of the other issues, but I'm wondering what would happen to the user data if the Jsonnet code and schema are changed between logins. Would the user be effectively recreated with the most recent schema and Jsonnet, or would some old version be run?

aeneasr commented 1 year ago

We would add the current identity data to the jsonnet context, and then it's your decision

netthier commented 1 year ago

Has there been any progress on this?

kmherrmann commented 1 year ago

We've added the ability to update identities from webhooks, see here: https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks#update-identity-traits

Would that solve the problem for you?

netthier commented 1 year ago

We've added the ability to update identities from webhooks, see here: https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks#update-identity-traits

Would that solve the problem for you?

No, as I need the update to happen during sign-in and the docs state the following:

Modifying the identity is currently only possible during the registration and settings flows.

In my case an external social login is the source of truth for identity data. I want the Jsonnet logic that constructs the identity from the JWT to run on every sign-in, potentially updating out-of-sync values.

kmherrmann commented 1 year ago

I see, makes sense, thanks. I'll add it to the backlog, but a PR would accelerate it :)

github-actions[bot] commented 3 months ago

Hello contributors!

I am marking this issue as stale as it has not received any engagement from the community or maintainers for a year. That does not imply that the issue has no merit! If you feel strongly about this issue

Throughout its lifetime, Ory has received over 10.000 issues and PRs. To sustain that growth, we need to prioritize and focus on issues that are important to the community. A good indication of importance, and thus priority, is activity on a topic.

Unfortunately, burnout has become a topic of concern amongst open-source projects.

It can lead to severe personal and health issues as well as opening catastrophic attack vectors.

The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone.

If this issue was marked as stale erroneously you can exempt it by adding the backlog label, assigning someone, or setting a milestone for it.

Thank you for your understanding and to anyone who participated in the conversation! And as written above, please do participate in the conversation if this topic is important to you!

Thank you 🙏✌️

kghost commented 2 months ago

@kmherrmann would you please reopen this one ? this issue is not fixed yet.

kriscoleman commented 1 month ago

@kmherrmann we ran into this too.

We updated our claims and now existing users seem to now be broken. Having a way to resync the traits on sign-in would be a graceful way to fix this.

aeneasr commented 2 weeks ago

This isn’t on the roadmap right now due to lack of commercial demand (hence we can’t prioritize it) but it’s certainly a good and welcomed feature. We‘ll let you know if something changes!