Repository navigation
feat(auth): notify about unset FUSION_OIDC_ALLOWED_USER; derive OIDC redirect URI - #289
Merged
Merged
Conversation
…redirect URI Without FUSION_OIDC_ALLOWED_USER any account on the identity provider can sign in to this single-user app. A future release will require it; this release only warns, so existing deployments keep starting. - GET /api/app returns notice codes (`notices`, always an array). The first code, oidc_allowed_user_unset, is set when OIDC is configured without an allowed user; a startup warning is logged too. - The sidebar shows an alert icon next to "Fusion" when there are notices; clicking it opens a popover with the details (all locales). - FUSION_OIDC_REDIRECT_URI is now optional. When unset, the callback URL is derived per login request from the scheme and Host, stored with the state and reused in the token exchange. - A whitespace-only FUSION_OIDC_ALLOWED_USER now counts as unset. The popover was added with the shadcn CLI. The upstream base-vega registry item imports `cn` from a package named "cn"; the import was changed to "@/lib/utils" and the extra dependency was not added. Closes #284 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Two OIDC follow-ups: a non-breaking notice for deployments without
FUSION_OIDC_ALLOWED_USER(a future version will require it), and an optionalFUSION_OIDC_REDIRECT_URI.The redirect URI used at the token exchange always comes from the stored state, never from the callback request. A spoofed Host only produces a URI the IdP rejects.
Closes #284
Evidence
/api/apphas nonotices; OIDC without a redirect URI fails at startup (FUSION_OIDC_REDIRECT_URI is required…).After:
./scripts.sh test-backendand./scripts.sh test-frontendpass; mutation checks (dropredirect_urifrom the exchange, drop the[]init, ignore the configured URI, …) are all caught.redirect_uriequals the authorize one: OIDC login works with a derived URI (localhostand127.0.0.1Hosts,X-Forwarded-Proto: https) and with a configured one; changing Host at callback time has no effect.Merge Danger
Door: two-way
Blast Radius: auth
frontend/src/components/ui/popover.tsxwas generated bypnpm dlx shadcn@latest add popover, with one line changed: the upstream base-vega registry item importscnfrom a package namedcn(and adds it as a dependency). The import now uses@/lib/utilslike the othercomponents/uifiles; thecnpackage was not added.FUSION_OIDC_ALLOWED_USERused to reject every account; it now counts as unset (any account can sign in, and the notice is shown)./oidc/callbackpath must keep settingFUSION_OIDC_REDIRECT_URI; the derived URI always uses/api/oidc/callback.HostandX-Forwarded-Proto, the derived URI is wrong and login fails at the IdP; setting the variable fixes it.🤖 Generated with Claude Code