Skip to content

feat(auth): sign in with the server's identity provider and the new TV sign-in - #448

Merged
Quick104 merged 13 commits into
mainfrom
feat/external-sign-in
Oct 2, 2026
Merged

Quick104 merged 13 commits into
mainfrom
feat/external-sign-in

Conversation

@Quick104

@Quick104 Quick104 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: Silo-Server/silo-server#1799
Validation tasks: changes #336 C1; changes #337 C1, C2, C3, C4

Silo servers can now let people sign in with an identity provider, either OIDC (Authentik, Keycloak, Authelia, Pocket ID and others) or LDAP (Silo-Server/silo-server#1799). The Android phone app only offered a password form, so people on those servers had no way to sign in. The Android TV app offered a password form even where passwords are turned off. The server's TV sign-in also changed: codes are now eight digits, a phone opening a request is reported back to the TV, and a TV can withdraw its own request.

Solution

Provider sign-in on the phone.

  • The login screen shows "Sign in with " for each provider the server offers. It opens the server's sign-in page in a Custom Tab, never a WebView.
  • The flow uses PKCE S256 and always starts on the saved server address. The app accepts the result only when its iss equals that address's origin, and redeems the code only there, so a sign-in that comes back from another server is discarded.
  • A sign-in in progress survives the app being killed.
  • After an explicit sign-out, the next provider sign-in asks the provider which account to use, as does "Use a different account", when the server supports select_account.

Sign-out. Settings, the profile menu and "Switch account" now share one cleanup (SignOutTeardown). It saves pending settings first and clears every per-profile cache, title art included. Main's Settings sign-out didn't clear title art.

Settings → Sign-in lists the linked provider account, with Connect and Disconnect. Connect asks for the account password first; LDAP accounts link with their directory username and password. The section says when the provider is the only way to sign in, and it's hidden on servers without provider sign-in.

Android TV sign-in.

  • The TV shows an eight-digit code grouped 4+4, a QR code, and the server's public /activate address.
  • It shows "Continue on your phone" when a phone opens the code, and handles a canceled code.
  • Codes renew themselves and pause after an hour. The TV reports unreachable and rate-limited states, and says "You were signed out of …" after a session expires.
  • The password form is hidden on servers that only offer provider sign-in. On servers with a provider it says to use the phone instead.

Approving a TV from the phone.

  • "Sign in a TV" (the Settings row main called "Pair Device"): enter or scan the code, pick the saved server, and approve on a card that names the server and account.
  • "Not you?" keeps the TV's code ready while switching accounts. The phone then follows the TV through signing in, canceled, expired and declined.
  • The nearby-TV offer checks the matching code before approving.

The vendored API v2 fixtures are synced from the server PR's commit. New dependencies: androidx.browser 1.10.0 for Custom Tabs, and coil-svg (same version as Coil) for provider icons. The lockfiles and verification metadata only gain entries.

Validation

  • Unit tests: shared 1579, android-shared 1669, androidApp 783, androidTvApp 1189; 0 failures.
  • :androidApp:assembleDebug and :androidTvApp:assembleDebug pass.
  • CI's lint tasks and release bundles pass, as do the build supply-chain checks.
  • Room stays at database version 14.
  • Live against a sandbox server with Keycloak, on emulators, with the server and app branches as they were before the final rebase onto main:
    • Phone provider sign-in, the wrong-iss refusal, account switching, and Settings connect and disconnect.
    • Approving a TV from the phone, and six Android TV sign-in states.
    • An earlier build was also checked with an LDAP directory.
  • A build of main plus these changes, installed over an existing install on a physical Pixel, launches and keeps the app's data.
  • Not run: nearby (NSD) TV pairing between emulators, which sit behind separate virtual routers; the paused and rate-limited TV states; TalkBack speech (only the accessibility tree was checked).

Risks

AI Disclosure

  • Harness: Claude Code, run inside T3 Code
  • Tool(s): Claude Code with subagents and multi-agent workflows
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: per-repository reviews and four cross-repository audit rounds over the server, SDK, plugins and apps. For this app they found the saved-server relay risk, which led to the iss start-origin rule, a background-poll race, and approval without switching servers; all were fixed. Mutation runs covered the device-link and withdraw rules.

Note

Add server identity-provider sign-in and phone-based TV sign-in to Android apps

  • Phone login now discovers the server's OAuth providers, shows provider buttons with icons, and signs in through a native PKCE browser flow with account selection (NativeSignInCoordinator, SignInOptions).
  • TV login is rebuilt around a device-code sign-in machine with QR/user-code display, typed errors, lifecycle-aware polling, and nearby-phone pairing; the phone can push a server to a signed-out TV via a new CompanionPairingCoordinator flow that matches the TV's advertised deployment identity to a saved server.
  • Device pairing on the phone works per saved server: the user picks the server for a code lookup, approves in place without switching the active server, and sees post-approval follow-up outcomes.
  • Sign-out is centralized in SignOutTeardown; settings gain an external sign-in section for linking/unlinking OAuth and directory identities.
  • Server identity probing (ServerIdentityApi), external sign-in provider discovery, and identity-bearing device-login links are added to the shared network and navigation layers.
  • Risk: many behavioral changes — match-word approval is replaced by user codes and typed failure codes (PairingFailureCode), CompanionPairingApproval drops tvMatchCode, the legacy QrLoginCard/MatchCodeTiles TV UI and ActivePairingPanel in TvServerSetupScreen.kt are removed, and TV sign-in advertising is debug-build-only (AndroidTvModule).

Macroscope summarized 617646e.

…V sign-in

The phone signs in through the server's OIDC provider in a Custom Tab, offers
"Not you? Switch account", and connects or disconnects providers in Settings.
The TV shows an 8-digit code with a QR, follows opened and canceled states,
and hides the password form on provider-only servers; phones approve its code.
Every sign-out now runs one shared teardown, which also clears title art.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 131 files, which is 31 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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 8fce4db7-5a98-40f8-9bc0-8fc73854b4f8

📥 Commits

Reviewing files that changed from the base of the PR and between 1e903dd and 617646e.

📒 Files selected for processing (131)
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/pairing/CompanionPairingCoordinator.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/pairing/CompanionPairingNsdBrowser.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/pairing/PairingAuthPort.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/pairing/PairingReceiver.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/pairing/TvPairingAdvertiser.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/pairing/CompanionPairingCoordinatorTest.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/pairing/PairingReceiverTest.kt
  • androidApp/build.gradle.kts
  • androidApp/gradle.lockfile
  • androidApp/src/androidMain/AndroidManifest.xml
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/auth/NativeSignIn.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/auth/NativeSignInCoordinator.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/auth/NativeSignInPlatform.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/auth/SignOutTeardown.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/di/AndroidModule.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/navigation/AppNavigation.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/navigation/DeviceLoginRouteParser.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/navigation/DeviceLoginServerMatch.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/navigation/ExternalRouteNavigation.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/navigation/Routes.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/MainScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/auth/DevicePairingScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/auth/DevicePairingWrongServerScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/auth/LoginScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/auth/LoginViewModel.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/auth/ServerSetupScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/auth/ServerSetupViewModel.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/auth/SignInProviderButton.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/home/HomeScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/pairing/CompanionPairingBottomOverlay.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/pairing/CompanionPairingViewModel.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/settings/SettingsScreen.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/settings/SettingsViewModel.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/settings/SignInSection.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/settings/SignInSettingsViewModel.kt
  • androidApp/src/androidMain/res/values/strings.xml
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/auth/InMemoryPendingNativeSignInStore.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/auth/NativeSignInCompleterTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/auth/NativeSignInLinkTransportTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/auth/NativeSignInPersistenceTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/auth/NativeSignInTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/auth/SignOutTeardownTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/navigation/DeviceLoginRouteParserTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/navigation/DeviceLoginServerIdentityMatchTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/auth/ApprovalAccountSwitchTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/auth/DevicePairingSignInRequestTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/auth/LoginV2ConsumerTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/auth/LoginViewModelSsoTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/settings/SettingsViewModelOfflinePreferencesTest.kt
  • androidApp/src/androidUnitTest/kotlin/org/siloserver/silo/android/ui/screens/settings/SignInSettingsTest.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/di/AndroidTvModule.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/navigation/TvAppNavigation.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/navigation/TvRoute.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/QrCodePanel.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvLoginScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvLoginViewModel.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvPairDeviceScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvPairingPanel.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvServerSetupScreen.kt
  • androidTvApp/src/androidMain/res/values/strings.xml
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvLoginMatchCodeLayoutTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvLoginViewModelDeviceSignInTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvLoginViewModelRaceTest.kt
  • androidTvApp/src/androidUnitTest/kotlin/org/siloserver/silo/tv/ui/screens/auth/TvPairingPanelCopyTest.kt
  • baselineprofile/gradle.lockfile
  • docs/api-v2/android-migration-status.md
  • docs/auth-api-v2.md
  • gradle/libs.versions.toml
  • gradle/verification-metadata.xml
  • scripts/sync-apiv2-fixtures.sh
  • shared/src/androidMain/kotlin/org/siloserver/silo/network/AndroidServerRegistry.kt
  • shared/src/androidMain/kotlin/org/siloserver/silo/network/EncryptedTokenManagerImpl.kt
  • shared/src/androidUnitTest/kotlin/org/siloserver/silo/network/EncryptedTokenManagerScopeGenerationTest.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/di/NetworkModule.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/di/RepositoryModule.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/model/auth/DeviceCodeFormat.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/model/auth/DeviceLoginModels.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/model/auth/ExternalSignInModels.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/model/server/ServerEntry.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/network/AuthInterceptorImpl.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/network/AuthScopeSnapshot.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/network/ServerRegistry.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/network/SiloAuthUnavailableException.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/network/TokenManager.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/network/api/AuthApi.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/network/api/AuthWireV2.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/network/api/DeviceLoginApi.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/network/api/ExternalSignInApi.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/network/api/ServerIdentityApi.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/network/apiv2/ApiV2Gate.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/pairing/PairingMessage.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/repository/AuthRepository.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/repository/DeviceLoginRepository.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/repository/DeviceSignInMachine.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/repository/ExternalSignInRepository.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/repository/ServerIdentityRepository.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/viewmodel/DevicePairingViewModel.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/model/auth/DeviceCodeFormatTest.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/network/SiloAuthPluginFreshActiveRefreshTest.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/network/SiloAuthPluginFreshPinnedRefreshTest.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/network/SiloAuthPluginRefreshFailureTest.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/network/api/ExternalSignInApiTest.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/network/apiv2/ApiV2ContractTest.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/network/apiv2/ApiV2NoFallbackTest.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/pairing/PairingProtocolGoldenFramesTest.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/repository/DeviceLoginRepositoryTest.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/repository/DeviceSignInMachineTest.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/viewmodel/DevicePairingServerChoiceTest.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/viewmodel/DevicePairingUiStateTest.kt
  • shared/src/commonTest/resources/api/v2/fixtures/SOURCE
  • shared/src/commonTest/resources/api/v2/fixtures/cancel_device_login_ok.json
  • shared/src/commonTest/resources/api/v2/fixtures/complete_account_identity_link_invalid_grant.json
  • shared/src/commonTest/resources/api/v2/fixtures/complete_oauth_login_invalid_grant.json
  • shared/src/commonTest/resources/api/v2/fixtures/complete_oauth_login_native_ok.json
  • shared/src/commonTest/resources/api/v2/fixtures/create_account_identity_link_ticket_ok.json
  • shared/src/commonTest/resources/api/v2/fixtures/create_account_identity_link_ticket_wrong_password.json
  • shared/src/commonTest/resources/api/v2/fixtures/delete_account_identity_last_sign_in_method.json
  • shared/src/commonTest/resources/api/v2/fixtures/get_device_login_capability_ok.json
  • shared/src/commonTest/resources/api/v2/fixtures/get_device_login_ok.json
  • shared/src/commonTest/resources/api/v2/fixtures/get_external_sign_in_capabilities_ok.json
  • shared/src/commonTest/resources/api/v2/fixtures/get_oauth_handshake_capabilities_ok.json
  • shared/src/commonTest/resources/api/v2/fixtures/get_system_info_ok.json
  • shared/src/commonTest/resources/api/v2/fixtures/index.json
  • shared/src/commonTest/resources/api/v2/fixtures/list_account_identities_ok.json
  • shared/src/commonTest/resources/api/v2/fixtures/list_auth_providers_ok.json
  • shared/src/commonTest/resources/api/v2/fixtures/poll_device_login_ok.json
  • shared/src/commonTest/resources/api/v2/fixtures/poll_device_login_opened.json
  • shared/src/commonTest/resources/api/v2/fixtures/refresh_session_provider_unavailable.json
  • shared/src/commonTest/resources/api/v2/fixtures/server_connections_ok.json
  • shared/src/commonTest/resources/api/v2/fixtures/server_identity_ok.json
  • shared/src/commonTest/resources/api/v2/fixtures/start_device_login_ok.json

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-02T17:06:53.000532Z f4dbddc New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@silo-kody

silo-kody Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 84b5a116f1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Quick104 commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Reviewed commit 84b5a116f19c4abb13961b07d4d78fa9f7215d37. Four actionable findings:

  1. [P1] Bind provider completion to the session that started it — AuthRepository.kt:150

    authenticate captures the session when the browser callback arrives. If someone starts provider sign-in, returns to Silo, and signs in with a password on the same server, the pending provider flow remains valid. Completing it then replaces the newer account's credentials and profile. Capture and validate the session at flow creation, and invalidate pending flows when another login or sign-out supersedes them.

  2. [P2] Persist a session identity that survives process restart — NativeSignInPlatform.kt:60

    Provider linking persists identityGeneration and credentialEpoch, then compares them on callback. Both counters are process-local and reset when Android recreates the app. A link started after login or profile changes therefore fails with identity_changed if Android kills the background process while the browser is open, despite unchanged saved credentials. Use a durable session identifier for this check.

  3. [P2] Allow token-based TV links to retry lookup — DevicePairingScreen.kt:228

    A supported silo://device?token=… link arrives with an empty code and automatically performs lookup. If that request fails, Continue stays disabled because it requires an eight-character code, while the code field is disabled because a token exists. Include token presence in canSubmit so the user can retry after connectivity returns.

  4. [P2] Wire the account lookup into nearby TV approval — CompanionPairingCoordinator.kt:208

    AndroidModule constructs this approver with only two arguments, so the new accountNameOf callback always returns null in production. Nearby approval consequently always says “your account,” including when approving with a different account saved on another server. Supply the scoped account lookup so users can identify which account they are granting to the TV.

These findings warrant changes before merge. This was a source review; I did not run local tests or device flows. The reviewed tests do not cover these scenarios.

AI-assisted review by Codex.

…oval gaps

A provider sign-in or link left open in the browser now records the saved
server's durable login id when it starts. The redirect is redeemed only while
that login is unchanged, so a password sign-in or sign-out in between
supersedes the flow, and a link still finishes after Android recreates the
process. Password sign-in and sign-out also discard the pending flow.

A silo://device?token= link can retry its lookup with Continue, and the nearby
TV approval card names the account it signs the TV in as.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b36cdd1732

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The phone now reports a TV's failed result that arrives before any code
(a different server at that address, an expired code) instead of waiting
out the 30-90 second timeout. A pairing connection that ended after a newer
advertiser start no longer touches that start's listener or busy flag.

The nearby TV card goes away and its pairing is cancelled when the route
hides the offer. In Sign-in settings, Cancel stops a link ticket request
still under way, and identities are shown only while the same login is
signed in. A TV approval whose sign-in context changed no longer cancels a
password attempt made since.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@Quick104

Quick104 commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the four findings from the review of 84b5a11 in b36cdd1:

  1. Provider completion bound to its session. A pending flow records the saved server's durable login id (TokenManager.loginSessionId, the login_authority_id each sign-in writes and each sign-out removes) when it starts. The completer redeems only while that id is unchanged. Password sign-in and SignOutTeardown also discard the pending flow.
  2. Link guard survives process restart. Linking checks that same persisted login id, the server, and the absence of a temporary overlay, in place of identityGeneration/credentialEpoch. A new test recreates the registry and token manager over the same prefs and finishes the link.
  3. Token links can retry. Continue is enabled when a token is present.
  4. Nearby approval names the account. AndroidModule passes the same scoped account lookup that "Sign in a TV" uses.

d0600a0 addresses the Kody findings on b36cdd1; each thread has its reply. The iss start-origin check, PKCE and redeem-at-saved-base logic is unchanged.

Validation: unit tests for shared, android-shared, androidApp and androidTvApp, :androidApp:assembleDebug, :androidTvApp:assembleDebug, and the CI lint tasks all pass locally with --no-daemon. Room stays at version 14, as on main.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d0600a015a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The TV polls a resumed code only while the sign-in context it was started
under is unchanged, and withdraws an expired code that failed to poll before
asking for a new one. On the phone, a code lookup goes only to the server
chosen when it started, a token link always uses the active server, an
unknown lookup status offers no decision, and nearby approval stops when
the card can't name the account. Provider discovery for a URL no longer
depends on the active server's update verdict.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
When a nearby phone approved the code, the sign-in screen now waits up to
five seconds for that session to finish its result and done exchange before
routing on, so the phone doesn't report a failed pairing for a TV that
signed in. A completed session routes on after its own dwell as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Consuming the sign-in success flag changes the effect's key, so doing it
before the wait cancelled the wait and its fallback route. It is consumed
after the wait now.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 904fb7aa8a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@silo-kody

silo-kody Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Sign-in settings now ignores a provider link result for another saved
server, so switching servers before opening Settings doesn't show one
server's "Connected" or failure on the other.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

The "Connected" message after a provider link is shown only if the link's
server is still the active one once the section has reloaded.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1fa464b9d0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

… them

A TV pairing attempt that outlived its connection (its session save can't
be cancelled) no longer reports its result into the newer connection. The
"Connected" message after a provider link also requires the same login,
not only the same server.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f4dbddcdc9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The nearby-TV card and its discovery are now off on the audiobook player
and book reader routes too, not only the video player and cast remote.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

The link under the provider buttons picks another account at the identity
provider, not another way into Silo, which read wrong on a server with
password sign-in off. With one provider it now says "Use a different
<provider> account"; with several it stays generic and opens the chooser.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@silo-kody

silo-kody Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104
Quick104 merged commit 74fc3e9 into main Oct 2, 2026
5 of 6 checks passed
@Quick104
Quick104 deleted the feat/external-sign-in branch October 2, 2026 19:54
Quick104 added a commit that referenced this pull request Oct 31, 2026
#747)

Release builds of the Android TV app never advertised st=login from the
sign-in screen, so phones couldn't offer to sign the TV in even though the
screen tells people to open Silo on their phone. The gate waited for both
phone apps to handle sign-in TVs; the Android app has since 1.0.0 (20)
(#448) and the iPhone app since silo-apple#579, and Apple TV turned its
gate on in every build with silo-apple#859.

Closes #742

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

1 participant