Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presented with a prompt to link account using password when pre-existing account does not use password auth method #400

Open
4 of 5 tasks
markaduol opened this issue Nov 14, 2024 · 7 comments
Labels
bug Something is not working.

Comments

@markaduol
Copy link

Preflight checklist

Ory Network Project

https://interesting-mcnulty-i7fnu6z46n.projects.oryapis.com

Describe the bug

When trying to sign-in with SSO, I am presented with a prompt to link my account using a password even though my pre-existing account does not use the password auth method

Steps to reproduce:

  1. Setup Enterprise SSO connection and via self-service registration, create an account that is managed by the SSO organisation.
  2. Remove the Google OIDC connection for my Enterprise SSO organisation
  3. On the same organisation, setup a new Google OIDC connection
  4. The OIDC connection now has a different redirect URI
  5. Try to sign in with SSO
  6. Run into this prompt asking me to link my account by providing a password
  7. Can't provide a password because my account has no password auth method (only the outdated OIDC auth method)
  8. Therefore, can't link account and so can't login using the new OIDC connection
    Screenshot 2024-11-14 at 10 40 43

Reproducing the bug

Follow steps described in the previous section

Relevant log output

No response

Relevant configuration

No response

Version

Ory Network

On which operating system are you observing this issue?

macOS

In which environment are you deploying?

Ory Network

Additional Context

No response

@markaduol markaduol added the bug Something is not working. label Nov 14, 2024
@markaduol
Copy link
Author

Furthermore, the CX in the ticket description occurs only when login hints are not enabled. When they are enabled, no form field is displayed.

Screenshot 2024-11-14 at 10 50 32

@hperl
Copy link

hperl commented Nov 14, 2024

Thanks for the report! This is what I found out so far:

  • If you delete the old OIDC SSO connection, the credential is still part of the identity, so if you then use the new OIDC connection, it wants to use the previous credentials to confirm
  • Since that is deleted, you get an empty screen (when login hints are enabled); when login hints are disabled, you get a generic collection of authentication methods, because it mustn't tell you the available credentials

This also applies to other flows that use account linking, but then you usually can recover your account.

I can think of two ways to resolve this

  • special-case account linking to allow linking of accounts between providers of the same organization
  • allow to confirm account linking using the code or link strategy (getting a code sent to the user's email address).

@jonas-jonas @aeneasr WDYT?

@markaduol
Copy link
Author

allow to confirm account linking using the code or link strategy (getting a code sent to the user's email address).

I found that the code linking strategy allows me to complete account linkage and sign in successfully. However, the only issue is that it comes with a confusing UI on the registration and login pages.

Standard login page

Screenshot 2024-11-14 at 11 19 27 copy

After filling in email with an email domain targeted by the Enterprise org

Screenshot 2024-11-14 at 11 20 14 copy

@aeneasr
Copy link
Member

aeneasr commented Nov 14, 2024

The UI will improve with the new release of ory elements. Right now this appears to be an edge case because it involves multiple steps that are not very common (removing an org and then re-adding the same provider again). As such we can keep the report open but I would not expect a timely resolution

@markaduol
Copy link
Author

Does this mean it is not possible to remove an Enterprise SSO org and still support basic registration and login?

@aeneasr
Copy link
Member

aeneasr commented Nov 14, 2024

It means that this sequence is not fully supported:

Steps to reproduce:

  1. Setup Enterprise SSO connection and via self-service registration, create an account that is managed by the SSO organisation.
  2. Remove the Google OIDC connection for my Enterprise SSO organisation
  3. On the same organisation, setup a new Google OIDC connection
  4. The OIDC connection now has a different redirect URI
  5. Try to sign in with SSO
  6. Run into this prompt asking me to link my account by providing a password
  7. Can't provide a password because my account has no password auth method (only the outdated OIDC auth method)
  8. Therefore, can't link account and so can't login using the new OIDC connection

If your user does not have an auth method, it is not possible to securely link them to the account. How would it? In general, don't remove OIDC providers once they're used by someone to log in, as you risk locking them out of their account.

Because B2B SSO disables account recovery, you essentially removed ALL auth methods for the user, and a way for them to recover. The account is simply bricked until you intervene, reset the org id on the user, reset their account, and then ask them to link again.

Now that I'm writing this, I don't think this is a use case we would support. We should probably document it that it's a really, really bad idea to remove 3rd party sign in providers after users have used them to sign in.

@markaduol
Copy link
Author

The ideal solution in this case would be to prevent an account from ever falling into this state - even accidentally. It is like the equivalent of allowing a process to enter a deadlock.

I would even argue that the previous issue, emerged by allowing an account to enter a state where in which no auth methods were available. Issue: #399

There should probably be some static check verifying that at any given point, an account has at least one auth method that can be used for sign-in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

No branches or pull requests

3 participants