Skip to content

fix(auth): use prompt=login instead of select_account for OIDC sign-in - #347

Merged
mortondev merged 1 commit into
QuackbackIO:mainfrom
gabemeola:fix/oidc-prompt-select-account
Jul 31, 2026
Merged

fix(auth): use prompt=login instead of select_account for OIDC sign-in#347
mortondev merged 1 commit into
QuackbackIO:mainfrom
gabemeola:fix/oidc-prompt-select-account

Conversation

@gabemeola

Copy link
Copy Markdown
Contributor

Fixes: #346

Summary

Custom OIDC sign-in fails for identity providers that don't implement the optional prompt=select_account value. buildGenericOAuthConfigs hardcodes prompt: 'select_account' for every provider, so the authorization request is rejected before authentication and the user is bounced back to /?error=invalid_request.

Reproduction

Configure a Custom OIDC provider backed by Clerk (https:///.well-known/openid-configuration).
Run Test sign-in — succeeds.
Attempt a normal sign-in via the provider button / verified-domain routing — fails and redirects to:
/?error=invalid_request&error_description=...Used+unknown+value+'[select_account]'+for+prom

Root cause

apps/web/src/lib/server/auth/build-oauth-configs.ts sends prompt: 'select_account' on every generic-OAuth config. select_account is optional per OIDC Core §3.1.2.1; providers that don't support it (Clerk, and others) return invalid_request rather than ignoring it.

This also explains why Test sign-in passes but real sign-in fails: the SSO test flow in apps/web/src/lib/server/functions/sso-test.ts already uses prompt: 'login', so the test never exercised the value production actually sends.

Fix

Send prompt: 'login' in production, matching the SSO test flow. login is broadly supported (Clerk, Okta, Auth0, Entra, Google, Keycloak) and preserves the original intent — forcing re-authentication so an admin isn't silently signed in under an existing IdP session. It also removes the test/production divergence, so a passing SSO test now exercises the same prompt production uses.

select_account is optional in OIDC and IdPs like Clerk reject it with
invalid_request, breaking sign-in while the SSO test (which uses login) passes.
@CLAassistant

CLAassistant commented Jul 29, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@mortondev mortondev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gabemeola, happy to merge this. 👍

In future this will become a configuration option, though I agree login should be the default.

@mortondev
mortondev merged commit 4273910 into QuackbackIO:main Jul 31, 2026
3 checks passed
@gabemeola
gabemeola deleted the fix/oidc-prompt-select-account branch July 31, 2026 16:30
@gabemeola

Copy link
Copy Markdown
Contributor Author

@mortondev Thanks! I'll pull in the next release when ready

mortondev added a commit that referenced this pull request Aug 1, 2026
The comment still said "force the account picker" after #347 switched
from select_account to login; describe the re-authentication behavior
and why login is used over the OIDC-optional select_account.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clerk authentication not supported

3 participants