Repository navigation
feat(auth): add OIDC and LDAP sign-in and TV device sign-in - #1799
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important Review skippedToo many files! This PR contains 277 files, which is 177 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (277)
You can disable this status message by setting the
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Adds sign-in through one external identity provider per server, provided by auth_provider.v1 plugins (OIDC and LDAP): account resolution and linking, group-gated account creation, role sync, break-glass local admins and a server switch for local password sign-in, a native app handoff with PKCE that binds the result to the app's saved server, provider re-checks that revoke refused accounts, and web sign-in, account and admin screens. TV device sign-in gains eight-digit codes, a 15-minute lifetime, an /activate link on the public URL, an opened signal and device-side cancel. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
cfa1d9a to
9493206
Compare
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@macroscope-app revoew |
|
Manual reviews triggered for commit All prior checks · these links stay valid even if you push more commits. |
|
Review started; results will be posted as check runs. |
|
The Web admin results for #1197 C1 and C2 need a re-check after merge: the admin user page now always shows a Sign-in tab, an extra entry point during account/policy setup and invitation membership checks. The current Suggested fix (no diff; this is PR description text): Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
|
The passed Web-admin cases #1197 C1/C2 and #1200 C1/C2 need a minor re-check: the account-detail page now shows a Suggested replacement: Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
There was a problem hiding this comment.
Reviewed the original head 9f6ea58 and the author’s subsequent commits. All ten independent findings are repaired at d6773b8, including the earlier fixes in b1b9ecd. Main’s invitation changes are reconciled, and the released SDK v0.22.0 is pinned.
[P1] Serialize local password sign-in with provider linking — internal/auth/service.go, loginWithProvider
A password sign-in can authenticate an account and pause before its session is inserted. A concurrent email auto-match then links that account to a verified external identity, disables its local password and revokes existing credentials. The paused local sign-in resumes and creates an identity-free session after revocation; refresh still succeeds, so the former local account holder retains access outside provider re-checks. A deterministic database test reproduced the successful sign-in and refresh with local password sign-in already disabled. Recheck the account and local-password authority under its row lock in the transaction that inserts the session. Fixed in b1b9ecd; focused database race regressions passed.
[P1] Revalidate current authority during OAuth completion — internal/auth/service.go, OpenOAuthSession
Redemption reads an enabled account without holding its row lock, then inserts the session. A deterministic database test held that account row while redemption began, committed account disable and credential revocation, and observed redemption create a fresh unrevoked session from its earlier enabled-account snapshot. The issued token grants access even though the account is already disabled. A separate callback → installation disable → redemption test also opened a valid session, although the documented contract says a disabled installation accepts nobody. Re-read the account under its row lock and check the installation in the redemption transaction before opening the session. Fixed in b1b9ecd; focused database race regressions passed.
[P2] Keep device approval results on the request that submitted them — web/src/pages/ActivateDevice.tsx
At 1c8029f, approve one TV and choose “Enter another code” while its POST is still in flight. Load a second pending TV, let the first approval succeed, then fail its follow-up GET. The second TV now shows “Done. Your TV is signing in.” even though the only approval POST used the first code. A deferred-response renderer test reproduces this on the new source; the same test leaves the second TV pending on b1b9ecd. Give each code/token its own component state so late responses cannot change a different request. Fixed in d6773b8. All 15 activation tests passed; before/after captures of the real component confirm the second TV stays pending.
[P1] Keep failed ACTIVE role synchronization due after an outage — internal/auth/provider_recheck.go
An unavailable identity becomes due after the short outage retry interval. If its next ACTIVE/USER answer rotates state but administrator demotion then times out on an account lock, 1c8029f restores the previous timestamp while leaving its status active. With that timestamp only three minutes old and the normal 12-hour interval, the next refresh skips the provider and issues another administrator token. A deterministic database proof reproduced this using the normal interval. Clear the failed role-sync check timestamp so the next refresh remains due while retaining the replacement state and latest successful-authentication time. Fixed in d6773b8. The new regression and seven related database tests passed with race detection.
AI disclosure: Codex harness in T3 Code; gpt-6.1-sol, with independent subagent reviews of accounts, provider re-checks and web/API flows.
|
Major changes:
Minor changes:
The user-management results #1196 C1–C2 and #1197 C2 remain unchanged with local password sign-in on: the new invite/break-glass guards do not change those steps under the default setting. #1190 C1–C2's local API-key checks are also unchanged; provider re-check revocation applies to externally linked identities. I could not enumerate Validation tasks in Suggested fix (no diff; replace the
Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
|
The Suggested corrected line: Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
A password sign-in that names a provider by ID now resolves only built-in providers and credentials (directory) plugins. Naming an OAuth plugin fails as wrong credentials before the plugin is asked, so the password never reaches it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
The Owner is the one account that must never be locked out by a sign-in provider outage. First-run setup and every ownership move now mark the new Owner break-glass, and a migration marks the existing one, so it keeps password sign-in when local sign-in is off and when it links a provider. The Owner can still clear the flag on its own account while another usable break-glass admin exists. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Show one sign-in plugin at a time as numbered setup steps built from its manifest's admin_form sections, with collapsible sections under Advanced. Plugin config and account creation now save from the page save bar; turning a provider on or off still applies at once, and Turn on waits for the required fields. The connection test can ask for a look-up user named by capability metadata without saving it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
| for (const schema of layout.unsupported) { | ||
| if (schema.required) missing.push(schemaTitle(schema)); | ||
| } |
There was a problem hiding this comment.
Incorrect missing-entry detection in missingSignInSetup marks every unsupported required schema as missing without checking for a saved global config entry, causing ProviderPanel to disable Turn on even after configuration on the linked plugin page. Preserve saved-entry presence checks for unsupported schemas and report only required entries that have not been saved.
Prompt for LLM
File web/src/pages/admin-settings/signInSetup.ts:
Line 187 to 189:
Incorrect missing-entry detection in missingSignInSetup marks every unsupported required schema as missing without checking for a saved global config entry, causing ProviderPanel to disable Turn on even after configuration on the linked plugin page. Preserve saved-entry presence checks for unsupported schemas and report only required entries that have not been saved.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
There was a problem hiding this comment.
Fixed in 816114e. An entry the page can't render now records whether it has a saved value, and missingSignInSetup reports a required one only while nothing is saved. Covered in signInSetup.test.ts.
There was a problem hiding this comment.
Thanks—that addresses the reported issue: unsupported required entries should block Turn on only when no saved value exists. The regression coverage in signInSetup.test.ts covers that distinction.
I haven’t independently verified commit 816114e54.
| update(installation.id, (current) => { | ||
| const config = { ...current.config }; | ||
| delete config[key]; | ||
| return { ...current, config }; | ||
| }); |
There was a problem hiding this comment.
Race condition in draft cleanup deletes newer, unsaved values when an admin edits an entry in SignInConfigField while mutateAsync is pending, because successful config saves unconditionally delete the current draft. Delete the draft only if it still matches the submitted entryDraft snapshot, and apply the same protection to autoProvision cleanup.
update(installation.id, (current) => {
if (current.config[key] !== entryDraft) return current;
const config = { ...current.config };
delete config[key];
return { ...current, config };
});Prompt for LLM
File web/src/pages/admin-settings/useSignInProviderDrafts.ts:
Line 220 to 224:
Race condition in draft cleanup deletes newer, unsaved values when an admin edits an entry in SignInConfigField while mutateAsync is pending, because successful config saves unconditionally delete the current draft. Delete the draft only if it still matches the submitted entryDraft snapshot, and apply the same protection to autoProvision cleanup.
Suggested Code:
update(installation.id, (current) => {
if (current.config[key] !== entryDraft) return current;
const config = { ...current.config };
delete config[key];
return { ...current, config };
});
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
There was a problem hiding this comment.
Fixed in 816114e. A successful save drops an entry's draft only if it is still the draft that was sent; an edit made while the write was in flight stays staged. Account creation gets the same check. Covered by "keeps an edit made while its entry was saving".
There was a problem hiding this comment.
Thanks—based on your description, the fix in 816114e54 addresses this race for both config entries and account creation. The snapshot check preserves edits made while a save is in flight, and the regression test covers that scenario. No further changes requested for this finding.
| const binding = authBindingOf(installation); | ||
| await updateBinding.mutateAsync({ | ||
| installationId: installation.id, | ||
| body: { | ||
| capability_id: capability.id, | ||
| enabled: binding?.enabled ?? false, |
There was a problem hiding this comment.
Race condition in auto-provision saves can undo Turn off during a pending config save: the subsequent whole-row binding write sends enabled from the installation snapshot captured before the asynchronous config saves, and RuntimeConfigStore.UpsertAuthBinding overwrites enabled. Serialize binding changes with the page save or prevent immediate binding changes through the independent mutation until the page save finishes.
Prompt for LLM
File web/src/pages/admin-settings/useSignInProviderDrafts.ts:
Line 228 to 233:
Race condition in auto-provision saves can undo Turn off during a pending config save: the subsequent whole-row binding write sends enabled from the installation snapshot captured before the asynchronous config saves, and RuntimeConfigStore.UpsertAuthBinding overwrites enabled. Serialize binding changes with the page save or prevent immediate binding changes through the independent mutation until the page save finishes.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
There was a problem hiding this comment.
Fixed in 816114e. Binding writes now share a mutation key. Turn on and Turn off are disabled while the page save runs or another binding write is in flight, and Save is disabled while a binding write is in flight, so the whole-row write can no longer restore an older enabled. Covered by "holds Turn off while the page is saving" and "holds the save while a provider is being turned off".
There was a problem hiding this comment.
Thanks—this addresses the reported race as described. Blocking Turn on/Turn off during the page save, and blocking Save while a binding write is in flight, prevents the stale whole-row write from undoing Turn off.
The two regression tests cover both orderings. I haven’t independently inspected 816114e54 or run the tests, but the reported fix resolves the concern.
A saved entry's draft is dropped only if no edit arrived while it was saving, and the same holds for account creation. Turning a provider on or off waits for the page save, and the save waits for a binding write, since both write the whole binding row. A required entry the page can't render no longer counts as missing once it has been saved. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
…support # Conflicts: # go.mod # go.sum
The getDeviceLogin and pollDeviceLogin approvals belong to the change Silo-Server#1799 merged, so the contract check reports them as stale against the new base.
The two device-login approvals belong to the change Silo-Server#1799 merged, so the contract check reports them as stale against the new base.
Adding a response enum value is breaking-class before the lock. Only the web admin reads sign_in_mode, and this branch teaches it the value. The approvals #1799 carried no longer match a change against main, so they go. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ins (#1828) * feat(auth): sign in with network identity through network access plugins A network access provider plugin whose auth_provider.v1 capability declares the "network" mode (such as the Tailscale plugin) can sign in the owner of the device a request came from, with no password and no browser, so a TV on the tailnet signs in with one button. The plugin stamps X-Silo-Ingress-Peer next to its ingress token; the middleware strips it everywhere and records the peer only with a valid token. The new signInWithNetworkIdentity and linkAccountIdentityWithNetwork operations ask the plugin who the peer is (NetworkIdentityAuth) and reuse account resolution, role sync and the provider re-check. listAuthProviders offers the provider only to requests from its own overlay, with the owner's name. One network binding may be on beside the one OIDC or LDAP binding. The web login page, account Sign-in settings and admin Sign-in page gain the matching controls. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix(auth): refresh the network sign-in button when the plugin's rules change Discovery cached a network provider's answer about a peer for 30 seconds per installation, so after an admin changed who may sign in, the "Continue as" button kept the old answer until the entry expired. Cache by provider instance instead: the registry builds new instances on every binding or plugin configuration change. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * build: pin the plugin SDK commit that adds network identity sign-in The server needs NetworkIdentityAuth and the "network" auth mode from the SDK. Pin that commit until the SDK release that carries it is tagged, then move to the tag. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * test(api): list the network sign-in routes in the media route manifest Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix(auth): let the primary provider decide for accounts that also sign in by network An account can hold an identity at the OIDC or LDAP provider and one at a network provider. Both applied their managed role, so a disagreement flipped the role and signed the account out at every sign-in and re-check, and a network refusal revoked every session and API key the primary provider still vouched for. The primary provider now decides: the network identity's role is ignored, and its refusal ends only the sessions opened through it. The docs and the admin Network sign-in section also say that a shared device signs in with its owner's role and that relays must be tagged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * chore(contracts): approve the network value of sign_in_mode Adding a response enum value is breaking-class before the lock. Only the web admin reads sign_in_mode, and this branch teaches it the value. The approvals #1799 carried no longer match a change against main, so they go. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix(auth): keep the primary provider's refusal and credentials authoritative over network sign-in Review follow-ups: - While the account's OIDC or LDAP provider refuses it, network sign-in answers not_permitted, so the overlay cannot undo deprovisioning. - A network provider that cannot re-check no longer deletes the API keys and Audiobookshelf sessions of an account the primary provider vouches for. - A network identity never links to an account by email auto-match. - signInWithNetworkIdentity declares 429. - The login page hides the password form when a network provider is the only way in. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix(auth): bound network discovery and keep network-only sign-in from passing the password-off guard Review follow-ups: - Discovery waits at most 2 seconds for the network plugin, so a hung plugin no longer stalls the provider list for the client's 10 seconds. - A discovery cache miss drops expired answers, including those of a provider instance a registry rebuild replaced. - Only network sign-ins look up the account's primary provider; OIDC and LDAP sign-ins no longer pay that query. - The admin "Turn on a sign-in provider first" guard counts only the OIDC or LDAP provider: a network sign-in reaches only people on its network. - The three binding writes on the Sign-in page share one helper and one account-creation default. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * build: pin the plugin SDK commit with network sign-in review fixes Moves the silo-plugin-sdk pin to 01bb1456e098, which refuses a network capability that does not serve CheckAccount and keeps network apart from password and oauth2 modes. The pin still moves to the v0.23.0 tag before merge. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix(auth): re-check the primary refusal when opening a network session and share discovery lookups Review follow-ups: - NetworkSignIn reads the primary provider's refusal again under the account lock while opening the session. A re-check that refuses the account holds that lock, so a refusal committed after account resolution no longer lets a fresh network session through. - Concurrent discovery misses for one peer share one plugin call, so an overlay client cannot multiply plugin calls by sending parallel listAuthProviders requests. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix(auth): honor pending primary refusals and bound the whole network preview lookup A primary-provider refusal whose revocation rolled back stays only in pending_refusal, so primaryAuthorityOf now reads it too: network sign-in and network sessions are refused while it is pending. Discovery's 2-second bound covered only the plugin call, not loading the plugin client (an installation read), so a stalled load held the shared lookup without a deadline. The timeout now wraps the whole shared lookup. The concurrent-lookup test waits until every caller has missed the cache before releasing the plugin, so it fails without the shared lookup. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * test(auth): signal network preview callers after they join the shared lookup The test hook fired before singleflight.Do, so a caller could still be outside the shared lookup when the test released the plugin. The preview now uses DoChan, which registers the caller before returning, and the hook runs after it, so every caller has joined the in-flight lookup before the plugin answers. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix(auth): refuse empty network peer answers and a second auth binding from one installation A plugin answering AuthenticatePeer with neither a response nor an error made network sign-in and linking panic before resolve could refuse it. Enabling a network binding beside the same installation's primary binding was allowed because the one-provider check compared only kinds. Identities and account rechecks are keyed by installation, so one installation now enables at most one auth binding. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix(auth): re-check the primary identity of accounts with live network sessions A refresh of a network session re-checks only the network identity, and the scheduled pass picked a primary identity only for API keys, Audiobookshelf sessions, or sessions opened through it. An account whose only credentials were network sessions therefore never had its OIDC or LDAP identity re-checked, so removal at the primary provider never ended those sessions or blocked new network sign-ins. The scheduled pass now also picks a primary identity while its account has a live session opened through a network identity. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * build: pin the plugin SDK to v0.23.0 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
- Replace the fork's consumed Silo-Server#1534 breaking-change approvals with upstream's own records for the changes this sync brings in: the device sign-in canceled status (Silo-Server#1799) and invitation links without email delivery (Silo-Server#1788, approved as Silo-Server#1390). The fork's gate compares against the pre-sync fork main, so it still sees them. - Give each fork row in the sample-entry admission table its own expected rejection. Upstream's Silo-Server#1869 now asserts its rows' message; the fork's extra rows are rejected by the fork's more specific checks. - Type the incomplete person in the person page test as a real Person instead of casting a number id and a null birth date. - Drop the two season plugin notice tests from the Silo-Server#700 draft; upstream's final Silo-Server#700 folded the same assertions into the image selection test. - Fix changed-line lint on inherited upstream code: reuse the If-None-Match and header parameter constants, and name the image cache provider and content-type strings and the auto subtitle sync off value.
Problem
Closes #905
Closes #554
Related issue: N/A
Validation tasks: changes #1193 C1, C2; changes #1194 C1; changes #1170 C1, C2; changes Silo-Server/silo-apple#320 C1; changes Silo-Server/silo-apple#321 C1; changes Silo-Server/silo-apple#326 C1; changes Silo-Server/silo-apple#327 C1, C2; changes Silo-Server/silo-android#330 C1; changes Silo-Server/silo-android#331 C1; changes Silo-Server/silo-android#336 C1; changes Silo-Server/silo-android#337 C1, C2; changes #1246 C1; changes #1229 C1; changes #1197 C1; changes #1200 C1, C2; #1196 C1, C2 and #1197 C2 unchanged while local password sign-in is on; local API-key cases #1190 C2, C3 and #1191 C1, C2 and server impersonation #1199 C1, C2 unchanged
Depends on: Silo-Server/silo-plugin-sdk#34 (merged, released as SDK v0.22.0). Plugins:
Silo-Server/silo-plugin-auth-oidc,Silo-Server/silo-plugin-auth-ldap.People can't sign in to Silo with the accounts they already have in a homelab identity provider (Authentik, Keycloak, Authelia, Pocket ID, Zitadel, Kanidm) or an LDAP directory. The
auth_provider.v1plugin contract existed, but the server could not use it safely. Sign-in results had no verified-email flag, groups or issuer, so accounts couldn't be matched or admins mapped. A person removed from the directory kept their Silo sessions and API keys. Admins couldn't make the provider the only way in without locking themselves out. The web OAuth button never left the page, becauseform-action 'self'blocks the redirect to the provider; #560 also addresses this. The phone and TV apps had no way to sign in through a browser at all.TV sign-in also needed work. Its eight-character letter-and-digit codes are awkward to type on a phone keypad, ten minutes is short for a first setup, and a TV that gave up left its code approvable.
This change adds external sign-in through one provider per server, plus the TV device sign-in changes. The plugins live in their own repositories.
Approach
One provider, local accounts stay. A server enables at most one external provider binding. Local password sign-in stays on by default. An admin can turn it off only while at least one enabled "break-glass" admin can still sign in with a password, and only the Owner marks an account break-glass. The Owner is break-glass by default (set at first-run setup and on every ownership move) and can turn that off for their own account, so a provider outage can't lock out the one account that must stay reachable.
silo auth local-login enableturns it back on from the host. While local sign-in is off, signup and invitations are refused (local_login_disabled), because they create password accounts.Account resolution. A sign-in maps to an account in this order:
auth.email_auto_matchon (off by default), an ordinary account with the same verified email. Admins, the Owner and break-glass accounts never match this way.Otherwise the refusal is
account_required. The provider can manage the account's role through its admin groups. Password sign-ins without a provider name are routed by account, so a local password is never sent to the directory.Provider re-checks. A session opened through the provider is re-checked with the plugin's
CheckAccountat refresh, once the last answer is older thanauth.provider_recheck_interval(12 h by default). A scheduled task re-checks identities whose credentials never refresh (API keys, Audiobookshelf sessions). A removed, disabled or refused account loses every session and its API keys. If the provider can't re-check (an OIDC provider that issued no refresh token), sessions stop sliding and end 30 days after the provider last vouched for them.auth.provider_recheck_outage_policychooses fail-open (the default) or fail-closed when the provider is down.Web and native flows.
iss, the origin where the native start first arrived. The app accepts it only if it equals its saved server's origin, and redeems the code only there, so a hostile saved server can't relay a sign-in by redirect.getProviderLogout).TV device sign-in. Codes are eight digits shown as 4+4 and last 15 minutes. The QR link is
<public URL>/activate?code=. The TV is told when someone opens its code, and a TV can withdraw its own request (canceled). Approving needs the approver's own login session, not an API key or an impersonation session. The frozen v1 routes keep their shape and report a canceled request as denied.Surfaces. v2 gains the identity, linking, connection-test and provider-logout operations, with capability endpoints
getExternalSignInCapabilitiesandgetOAuthHandshakeCapabilities. Tworesponse-property-enum-value-addedapprovals covercanceledon device-login lookup and poll;breaking-approvals.jsongives the reasoning. The web adds Settings → Sign-in for admins, a Sign-in section in account settings, a Sign-in tab on the admin user page, and provider buttons on login and/activate. Settings → Sign-in shows one provider at a time as numbered setup steps (register Silo, connect, choose who can sign in, test, login button) built from the plugin'sadmin_formsections; sections the plugin marks collapsible go under Advanced. Plugin settings and account creation save from the page's save bar with the server settings, while turning a provider on or off applies at once and needs its required fields saved first. Three migrations add the identity, flow and device-login columns and tables, and a fourth marks the existing Owner break-glass.The rules are written down in
docs/architecture/external-sign-in.mdanddocs/architecture/device-login.md; the API is indocs/auth-api.md.Validation
The following validation was reported by the author before independent review. Review verification is listed separately below.
go build,go vet,gofmtandmake test-gopass, exceptTestAdminResourceCapabilitiesAndScope, which also fails onmainon macOS (no cgroups).verify-*contract targets pass: settings bindings, playback fixtures, route inventory, migration ledger, scenario catalogs, offline routes, OpenAPI, the contract diff againstmain, fixtures and local paths.main:TestAdminSubtitleListPageDBandTestOrphanCleanupAfterPlexTableDropPostgres. A third,TestCollectionCollageReadsKeepActiveVariantsDB, failed only because the Docker database's clock lagged the host's.tscfails onmaintoo, becauseUserDetailTabs.tsxanduserDetailTabs.tsdiffer only in case.perf-budget.jsonis raised to 318,728 B. The login page loads eagerly, and it now carries the provider sign-in buttons; the API client also gains provider-outage handling on refresh./activate; native sign-in from the iOS, tvOS and Android apps on simulators and emulators.Review fixes preserve the submitting session for identity writes, refresh provider discovery, serialize local login and identity administration with account changes, and withdraw revoked provider approvals. Provider re-checks retain uncertain state, ignore answers after unlinking and use one database connection. Failed ACTIVE role synchronization remains due after an outage, and activation state is isolated for each code/token. OAuth completion locks account and installation authority through session creation and returns that account snapshot; native capability, origin matching, provider availability, invitation policy and Jellyfin retries have regression coverage.
Independent review verification:
TestAdminSubtitleListPageDB,TestCatalogTransferPersistsJobsAndSignedLinkandTestOrphanCleanupAfterPlexTableDropPostgres. The full API race run hit its ten-minute suite timeout while progressing through tests, with no race report.d6773b82da8c5939c97cdf42c6fea2239efb7030. Final follow-up checks passed: eight provider recovery database race tests, the full invitation database race suite, focused invitation/device API race tests, linking regression, web lint/format/build/budget and contract/fixture/path checks. One invitation ordering test failed once; focused repeats and the complete suite rerun passed. The local changed-line lint run is queued behind another run.Evidence: https://evidence.siloserver.org/r/silo-server/pr-1799/
Risks
break_glasson the existing Owner; an Owner whose password sign-in was already off stays off until a password is set. Databases that ran this branch's earlier unreleased migrations need a fresh database.docs/architecture/external-sign-in.md.isscheck does not stop a relay by request. A hostile server on a LAN address, or behind a network access provider, can send an app's native start to the real server itself.docs/auth-api.mddescribes this, and it is accepted.admin_formsections. The OIDC and LDAP plugins need manifest updates that are not released yet: steps and Advanced sections, standard labels (Bind DN, User search base DN, Token endpoint auth method, User identifier), andconnection_test_username_fieldfor the LDAP test user. With the current plugin releases the page still works, but every manifest section shows as its own numbered step.canceled. Older apps keep working: they show the codes and fall back to password sign-in.Checklist
AI Disclosure
gpt-6.1-sol, with independent subagent reviews and regression tests.issrule, browser-bound completion codes, and opening the session only when the code is redeemed. The independent Codex review reproduced ten findings and repaired them, alongside verified bot findings, with concurrency tests and private evidence.Note
Add OIDC/LDAP external sign-in, break-glass accounts, and TV device sign-in
PluginProviderRegistryafter binding changes instead of being fixed at startup.silo auth local-login enableCLI recovers access.openedsignal for approvers, device-side cancellation, and session-provider-chain inheritance. v1 routes keep their frozen behavior viaLegacyflags and status mapping.invalid_grant, invitation acceptance can fail with 403local_login_disabled, and completion rows no longer store provider tokens. Migrations add break-glass, device-login, and OAuth-flow columns/tables; v1 surfaces map canceled device requests to denied.Macroscope summarized faa6317.