fix(auth): recognize the OIDC-only auth mode so SSO login can start - #3380
Open
alysson-souza wants to merge 1 commit into
Open
fix(auth): recognize the OIDC-only auth mode so SSO login can start#3380alysson-souza wants to merge 1 commit into
alysson-souza wants to merge 1 commit into
Conversation
alysson-souza
force-pushed
the
fix/oidc-only-auth-mode
branch
from
August 16, 2026 16:33
1329074 to
5ebe9c5
Compare
The Auth Mode selector stores "sso" when a user picks OIDC only, but getOidcRuntimeConfig accepted only "oidc" and "both". With authMode "sso" it returned null, so /api/auth/oidc/start redirected to /login?error=oidc_not_configured while the login route already refused password login, leaving no way into the dashboard. Accept "sso" alongside "oidc" and "both" through a new isOidcAuthMode helper, matching how the login route, the auth status route, and the login page already read the setting.
alysson-souza
force-pushed
the
fix/oidc-only-auth-mode
branch
from
August 16, 2026 16:35
5ebe9c5 to
17bd60a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Selecting OIDC only under Profile → Single Sign-On locks the user out of the dashboard, with no supported way back in.
Password login returns
403 Password login is disabled. Use OIDC sign in., and the OIDC sign-in button lands on/login?error=oidc_not_configured. Recovery requires editing thesettingsrow in the SQLite database by hand.To reproduce on a working OIDC configuration: save a valid issuer, client ID, and client secret with Both, confirm SSO sign-in works, then switch to OIDC only and save.
Root Cause
The Auth Mode selector stores the literal value
ssofor OIDC only:https://github.com/decolua/9router/blob/master/src/app/(dashboard)/dashboard/profile/page.js#L1009-L1013
PATCH /api/settingspersists that value as-is, sosettings.authModebecomes"sso". From there the two login paths disagree:POST /api/auth/logintreatsssoas an SSO-only mode and rejects the password before checking it (src/app/api/auth/login/route.js:43-51).GET /api/auth/oidc/startcallsgetOidcRuntimeConfig(), which accepted only"oidc"and"both", so it returnednulland redirected to/login?error=oidc_not_configured(src/lib/auth/oidc.js:53).Every other reader of the setting accepts
sso: the login route above,GET /api/auth/status, and the login page (src/app/login/page.js:131,["sso", "oidc", "saml", "both"]).getOidcRuntimeConfigwas the only place that did not. The SAML path has no equivalent gate at all, so SAML only works from the same selector while OIDC only does not.Fix
Accept
ssoalongsideoidcandbothwhen resolving the OIDC runtime config, through a named helper so the accepted set is explicit and testable:The change is deliberately narrow. It does not alter what the selector writes, does not touch settings validation, and does not change
passwordorbothbehavior. Installations onoidcorbothare unaffected, and installations already saved asssostart working without a settings migration.Validation & Testing
New
tests/unit/oidc-auth-mode.test.js, following the existingtests/unitVitest conventions with@/lib/localDbmocked:getOidcRuntimeConfigresolves a config whenauthModeissso, the value the dashboard writes for OIDC only.both.nullforpassword.nullwhen an SSO mode is set but the OIDC credentials are incomplete, so the misconfiguration guard is preserved.isOidcAuthModeacceptssso,oidc, andboth, and rejectspasswordandundefined.Without the source change, the three
ssocases fail, so the tests pin the reported defect rather than the current behavior.The SAML utilities, the auth status route, and the dashboard guard all still pass.