authgear / authgear-server

Open source alternative to Auth0 / Firebase Auth
https://www.authgear.com
Apache License 2.0
81 stars 37 forks source link

How to handle updated OAuth profile with account linking enabled? #4517

Closed louischan-oursky closed 2 months ago

louischan-oursky commented 2 months ago

Once https://github.com/authgear/authgear-server/issues/4516 is fixed, we will have this problem.

  1. Sign up with a OAuth provider. The OAuth profile is {"sub": "UserA", "phone_number": "+85251000001"}. This is UserA.
  2. Sign up with phone number "+85251000001". With account linking, UserA now has a OAuth identity and a phone number Login ID.
  3. Sign up with a OAuth provider. The OAuth profile is {"sub": "UserB", "phone_number": "+85251000002"}. This is UserB.
  4. Sign up with phone number "+85251000002". With account linking, UserB now has a OAuth identity and a phone number Login ID.
  5. Go to the OAuth profile of UserA, change the phone number to "+85251000002".
  6. Sign in with OAuth profile {"sub": "UserA", "phone_number": "+85251000002"}.

How should we handle Step 6?

linear[bot] commented 2 months ago

DEV-1666 How to handle updated OAuth profile with account linking enabled?

louischan-oursky commented 2 months ago

Per offline discussion, we will do nothing special in Step 6. Since account linking allows create_new_account https://github.com/authgear/authgear-server/blob/main/docs/specs/account-linking.md#linking-actions , it is possible that more than 1 account sharing the same phone_number / email / preferred_username