platform icon indicating copy to clipboard operation
platform copied to clipboard

UX: "Change password" silently fails for Google/GitHub SSO-only accounts

Open varaprasadreddy9676 opened this issue 8 months ago • 10 comments

Summary

For accounts created exclusively via Google or GitHub SSO (no email+password identity), the Settings → Change password form accepts input and shows no error, but the password is never activated for direct email+password login. The user has no indication that the operation did nothing useful.

Steps to reproduce

  1. Create a huly.app account using Sign in with Google (never set a password)
  2. Go to Settings → Change password
  3. Leave "Current password" blank, enter a new password twice, click Save
  4. Try to sign in at huly.app with your email + that password
  5. Login fails silently (API returns platform:status:AccountNotFound)

Expected behaviour

One of:

  • Option A: The form succeeds and actually enables email+password login for the account (links the email identity with a password).
  • Option B: The form shows a clear message: "Your account uses Google login. To set a password, you must first verify your email via a one-time code." and redirects to the OTP flow.

Actual behaviour

  • The form accepts the input with no error
  • Email+password login still fails with AccountNotFound
  • The only working login path for SSO users is the OTP flow (loginOtp → validateOtp), but there is no UI hint pointing to this

Impact

  • Confusing for developers and power users trying to use API/CLI tooling (e.g. MCP servers, import scripts) that authenticate with email+password
  • No error feedback means users waste time debugging what appears to be a valid credential

Environment

  • huly.app (cloud)
  • Account type: Google SSO only
  • Observed via the @hcengineering/account-client SDK (login(email, password) returns AccountNotFound)

varaprasadreddy9676 avatar Mar 12 '26 10:03 varaprasadreddy9676

Connected to Huly®: UBERF-15858

huly-github-staging avatar Mar 12 '26 10:03 huly-github-staging

Root cause analysis

Traced the flow through the code:

Backend (server/account/src/operations.ts:1313-1346):

changePassword requires both oldPassword and newPassword to be non-empty. For SSO-only accounts (hash == null, salt == null), verifyPassword() always returns false — so even if a user guesses they should enter something, the backend rejects it with Forbidden.

Frontend (plugins/setting-resources/src/components/Password.svelte):

The save button is disabled until oldPassword.length > 0 (line 33), so SSO users can never submit. No indication is shown that the form is unusable for their account type.

Proposed fix

Option B (from the issue) is the right call — showing a clear message rather than silently enabling password-based login (which has security implications for SSO-managed accounts).

Implementation would be:

  1. Backend: Add hasPassword: boolean to the response of an existing account endpoint (e.g. getLoginInfoByToken) — derived from account.hash != null
  2. Frontend: Password.svelte checks hasPassword on mount:
    • If true: show the existing change-password form (current behavior)
    • If false: show a message explaining the account uses SSO login, with a link to the OTP flow if they want to set a password

Happy to submit a PR if the maintainers confirm the approach.

dnplkndll avatar Mar 17 '26 17:03 dnplkndll

UX Research: How major apps handle this

I surveyed how GitHub, Slack, GitLab, Atlassian, Figma, Linear, Notion, and Firebase handle the "change password" flow for SSO-only accounts. Three distinct patterns emerged:

Pattern 1: "Managed by [Provider]" — Hide the form entirely

Used by: Figma, GitLab

The password section in account settings shows a label like "Managed by Google" and disables/hides the password fields entirely. Users understand immediately that their identity provider controls their credentials.

  • Figma: Settings page shows "Managed by Google" — no password fields visible. To add a password, users go through the "Reset password" flow from the login page (email verification → set new password). This effectively converts the account to support both SSO and email+password.
  • GitLab: SSO accounts get an auto-generated random password. Admins can disable password auth entirely for SSO users. The password form is hidden when password auth is disabled.

Pattern 2: "Set a password" — Show a different form

Used by: Firebase (account linking pattern)

Instead of "Change password" (which implies one exists), show a "Set a password" or "Add password login" form that only requires the new password (no "current password" field). Usually gated behind email verification (OTP/magic link) to prove account ownership.

Pattern 3: Redirect to IdP — Don't handle it at all

Used by: Slack, Atlassian/Jira, Linear

Password management is fully delegated to the identity provider. The settings page either has no password section, or shows a message like "Password managed by your organization" with a link to the IdP's password change page.

  • Slack: SSO-only members don't have Slack passwords. To set one (e.g. before removing SSO), they must go through a separate flow.
  • Atlassian: Google SSO users hit a dead end trying to change passwords. Community threads show confusion — the answer is "change it in Google Workspace."

UX consensus

Approach Pros Cons Best for
Hide + "Managed by" Clearest UX, no confusion Users can't add password login Strict SSO environments
"Set a password" form Enables multi-method auth Needs email verification step Self-hosted / developer tools
Redirect to IdP Zero implementation Confusing when IdP doesn't manage Huly passwords Enterprise SAML only

Recommendation for Huly

Pattern 2 ("Set a password") is the best fit for Huly because:

  1. Huly supports mixed auth (SSO + email+password) — it's not a strict SSO environment
  2. API tokens and CLI tools benefit from having email+password as a fallback auth method
  3. Self-hosted users especially need this flexibility

Proposed UX flow:

  1. Password.svelte checks hasPassword (new field from account info)
  2. If hasPassword === true: Show current "Change password" form (no change)
  3. If hasPassword === false: Show a simplified form:
    • Header: "Set a password" (not "Change password")
    • Explanation: "Your account uses [Google/GitHub/OIDC] login. Set a password to also enable email + password sign-in."
    • Fields: New password + Confirm password only (no "current password")
    • Backend: verify account ownership via existing session token (user is already authenticated via SSO), then call setPassword() directly

This matches what Figma does but with a smoother in-app flow (no need to log out and use "Reset password" from the login page).

dnplkndll avatar Mar 17 '26 18:03 dnplkndll

Thanks for the thorough root cause analysis and the UX survey — really appreciate the legwork!

Pattern 2 ("Set a password") is the right call for Huly. The mixed-auth nature of the platform (SSO + email+password coexisting) and the API/CLI use-case make it important that SSO users can opt into email+password without leaving the app.

The proposed implementation looks solid:

  • hasPassword: boolean from account info to gate the UI
  • Show "Set a password" form (no "current password" field) when hasPassword === false
  • Verify ownership via the existing session token (user is already authenticated), then call setPassword() directly

Please go ahead and open the PR — happy to review and test.

varaprasadreddy9676 avatar Mar 17 '26 18:03 varaprasadreddy9676

@dnplkndll Please, no. Just show right message and link to reset password

BykhovDenis avatar Mar 17 '26 21:03 BykhovDenis

@BykhovDenis you don't think the account with only SSO should be allowed to set a password? Or what approach are you thinking? the linked PR is complete. Just does not ask for a password that does not exists and allows setting the New Password.

Image

I am not super familiar with the code base. Just trying to clean up issues while I have some free time!

dnplkndll avatar Mar 17 '26 23:03 dnplkndll

@dnplkndll Thanks for the contribution! My main concern is security. If the system is left logged in, someone could set a password without any confirmation or notification and then use it later.

Huly already allows setting a password via the password recovery link (https://huly.app/login/password), which I think is the safer and more appropriate flow.

Maybe instead of setting the password directly here, we could add a button that sends the recovery link to the user.

BykhovDenis avatar Mar 17 '26 23:03 BykhovDenis

I had to research a little if that would be able to work with all SSO providers since you do not always have an email? will try to add a confirm like on register.

dnplkndll avatar Mar 18 '26 01:03 dnplkndll

As of the current develop branch, SSO-only accounts no longer get the silent "Change password" form: Settings > Password now shows "Set a password" with an explanation and a "Send setup link" button that emails a confirmation link to set a password (or a hint if no email is linked). This was implemented in #10649, following the email-confirmed approach discussed above. @ArtyomSavchenko could you close this issue if you agree?

MichaelUray avatar Oct 17 '26 17:10 MichaelUray

@varaprasadreddy9676 — based on the check described above, this looks resolved in the current code. Could you please close this issue if you agree? If you think it is not fixed yet, please describe what still goes wrong (steps, expected vs. actual behaviour), so it can be looked at again.

MichaelUray avatar Oct 20 '26 20:10 MichaelUray