Repository navigation
Conversation
Keep existing installations enabled by default and make the sign-in policy and self-service factor decisions honor the server setting without changing stored credentials. Refs ZL154#345
Refuse passkey ceremonies before side effects, reject passkey sign-in bridge tokens, and share the effective challenge inventory across the provider, middleware and portal. Keep saved credentials visible for removal while reporting effective coverage and self-service eligibility. Refs ZL154#345
Check the exact configuration Jellyfin is about to save after the step-up gate and return a conflict listing users who still depend on passkeys. Reuse the challenge inventory for imports and inspect full-import replacement records before writing either configuration or user data. Refs ZL154#345
Keep each existing sign-in entry point compatible with the enabled default. Use the shared usable-method inventory only for the new disabled state and its turn-off guard, so upgrading does not normalize unrelated legacy challenge behavior. Refs ZL154#345
EmergencyLockout rearms PasskeyRequiresSecondFactor again from the stored credentials, as ZL154#343 did. Rearming only adds protection; tying it to the new switch left an opted-out passkey in place during an emergency taken while passkeys were off, and that passkey would skip the challenge once they were turned back on. Rename PasskeyPolicy.HasEnrolled to HasUsable: it returns false for a user with enrolled passkeys while the server has them off, so the old name misled exactly where the distinction matters. Document PasskeysEnabled, point HideBuiltInPasskeyButton to it, comment the public-config field, say when SignInFactors uses the shared inventory, and fix the whitespace of the new test files. Refs ZL154#345
…in pages The server refuses passkeys while PasskeysEnabled is off, so the pages stop offering them. inject.js leaves out the passkey sign-in button. The Setup page drops the registration controls, the ZL154#343 switch and the passkey option of its step-up prompt, and keeps saved passkeys listed with a notice so users can still remove them. The admin page gets the "Allow passkeys" setting next to email codes, offers the passkey in its step-up modal only while passkeys are allowed, and reads that again after a save. A save the server refuses with 409, because some users would be left without another way to verify their sign-in, now names those users as text in the page language and leaves the form as the admin left it. A refused save no longer ends in an uncaught promise rejection. The challenge page needs no change: it offers the passkey only when the server lists it, which a new test pins. New strings in all eight bundles, Node tests for each page, and the two new test files in CI. Refs ZL154#345
Explain what turning passkeys off does on the server and on the pages, why turning it off is refused while a user depends on a passkey, the two ways out, and how it differs from hiding the passkey button. Point to it from the passkey section and from the hide-buttons section. Refs ZL154#345
2 tasks done
The turn-off guard only looked for users with nothing left to answer the sign-in challenge. Two other ways the switch could quietly drop a second factor slipped through: - an email or recovery code answers the challenge but never makes it required, so a user whose passkey choice was the only reason password sign-in asked for a second factor would be left with the password alone; - a recovery code or a Telegram chat answers the challenge but is not a self-service factor, so the Setup page step-up would stop asking for proof. The guard now lists a user with stored passkeys when any of the three holds, through the challenge inventory, the sign-in challenge policy (with the user's administrator status for the enforcement scope) and the self-service factor list as they are. The refusal, the settings help text and the README now say that these users rely on a passkey for their second factor. Also drop a needless cast and simplify an assertion in the save tests. Refs ZL154#345
This was referenced Nov 21, 2026
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
I added Allow passkeys (
PasskeysEnabled), on by default, so an administrator can turn passkeys off for the whole server, for example to keep the authenticator app as the only second factor. While it is off, the server refuses every passkey ceremony, a saved passkey stops counting as a factor, and the login, Setup and admin pages stop offering passkeys. Saved passkeys and each user's #343 choice are kept, so turning the setting back on restores them. Turning it off is refused while some user relies on a passkey for their second factor, and the settings page names those users.Type of change
Related issues
Closes #345
The issue offered two ways to handle an account whose only second factor is a passkey, and I went with the first: the save that would turn passkeys off is refused while such accounts exist, and the settings page lists them. That way off means off for everyone, with no account keeping a passkey that the server refuses for everybody else, and nobody loses a second factor without the administrator seeing their name first.
What changes
Setting.
PasskeysEnabledsits next toEmailOtpEnabledand defaults to true, so a configuration written by an earlier version (XML or JSON without the field) reads as on and nothing changes on upgrade. Exports carry it.GET /TwoFactorAuth/public-configreports it aspasskeysEnabledfor the pages;hideBuiltInPasskeyButtonkeeps meaning only that the login button is hidden.Refused ceremonies. While it is off, eight endpoints answer HTTP 400 with
{"message": "Passkeys are disabled on this server."}before they read user state, start or consume a ceremony, count toward a rate limit or a failed attempt, or write an audit entry:Passkeys/RegisterBeginandPasskeys/RegisterFinish,Passkey/LoginBeginandPasskey/LoginComplete(passwordless sign-in, with or without a username),Verify/Passkey/BeginandVerify/Passkey/Finish(the challenge), andStepUp/UserPasskeyBeginandStepUp/UserPasskeyVerify(the step-up prompt on the Setup page and in the admin modal). A sign-in bridge token minted by a passkey sign-in is refused too. Listing and removing saved passkeys, their diagnostics and the #343 preference keep working, so users can clean up.Stored passkeys stop counting. While it is off, a saved passkey no longer makes password sign-in ask for a second factor, cannot answer the challenge, no longer counts as an existing factor for the hardened self-service gate or for creating app passwords, and is left out of the security score, the enrollment statistics and the dashboard coverage. With passkeys off, the provider, the middleware and the portal build the challenge from one shared inventory: a verified authenticator app, unused recovery codes, and email codes when email OTP is on and the account has an address or a linked Telegram chat. A linked SSO provider alone cannot answer a local challenge, so it does not count. While passkeys are on, each sign-in entry point keeps exactly the offers it had before this setting existed; the shared inventory is used only while they are off.
Refused turn-off. Only a change from on to off is checked, with the settings the same save would apply. A user with a saved passkey relies on it when any of these holds: nothing in that inventory is left to answer their challenge; their passkey choice was the only reason password sign-in asked for a second factor (no enforcement scope covers them and they have no authenticator app; an email or recovery code can answer the challenge but never makes it required); or the passkey was their only self-service factor, so the step-up would stop asking for proof before a change. Each test is the plugin's own rule: the challenge inventory, the sign-in challenge policy with the user's administrator status, and the self-service factor list. While any user relies on a passkey, the save is refused with HTTP 409 and
{"message": ..., "users": [{"id": ..., "name": ...}]}, sorted by name, and nothing in that save is applied. Users deleted from Jellyfin are not counted. The check runs on the exact configuration object Jellyfin deserialized, after the existing step-up filter (which still answers first with its 403) and before secrets are restored or anything is saved. A configuration import that would turn passkeys off is refused the same way before any write, with its existing HTTP 400 shape and the same text, and a full import is checked against the user records it would write.Emergency lockout. I lost my phone still turns the #343 choice back on from the stored passkeys, whatever the setting says, as it does since #343. That only adds protection, and it keeps an opted out passkey from skipping the challenge if passkeys are turned back on later.
Pages.
passkeysEnabled(an older server, or public-config not read) reads as on, and the server refuses passkeys while they are off whatever a page shows.README. A Turning passkeys off subsection under Settings, with a pointer from the Passkeys section and from the section on hiding the login buttons.
How was this tested?
Server tested against: none, I did not run a Jellyfin server for this PR.
Clients tested with: none against a server; I looked at the admin and Setup pages in headless Chrome against a local stub of the plugin API, and I did not use a hardware authenticator.
C#: I added tests for the missing field and the XML and JSON round trips, 192 combinations of the factor policy inputs, all eight refused endpoints (no counter, nonce or record change), saved passkey removal and the #343 preference while off, the refused passkey bridge token, status and coverage, the shared inventory and the unchanged offers of each entry point while passkeys are on, and the emergency rearm while off. The save tests go through the real MVC pipeline, the step-up filter and the plugin's update override with Jellyfin's own JSON options, and cover the sorted 409 body, the alternative factor matrix, users whose passkey is the only reason for the challenge (by enforcement scope and administrator status) or their only self-service factor, the email setting changed in the same save, allowed transitions, deleted users and the step-up ordering; the import tests cover both forms, the no-write refusal and full import user records. Before each change I ran the new tests against the previous code and saw them fail. Afterwards I removed the key lines (the enabled check in the passkey rule, the eight early refusals and the bridge refusal, the save guard, the import guard, the use of the incoming configuration, each of the two turn-off conditions for the challenge reason and the self-service factor, the compatibility branch for the enabled state, the emergency rearm) and saw the targeted tests fail again.
Pages: the Node tests run the pages' own code against a stubbed
fetchand DOM.tests/passkeys-disabled-admin-page.test.mjsloads the whole admin script over a stand-in DOM and server: the checkbox from a true, false or missing field, the saved value, the 409 rendering (names as text, never markup, in the page language, no configuration reload, checkbox unchanged, nothing else saved), a 409 without users, other failures, and the step-up modal with and without passkeys allowed, including a save that changes the setting.tests/passkeys-disabled-setup-page.test.mjscovers the Passkeys card with and without saved passkeys while off, the removal of the last one, the #343 switch, the step-up prompt and the authenticator card.tests/login-button.test.mjsnow covers the passkey button with the field true, false and missing, andtests/passkey-challenge.test.mjsthe challenge page offer. Both new files are in ci.yml, and each new string is checked in all eight bundles. The new admin and Setup tests failed on the unchanged pages, and so did the login test for the off state. I then removed the key lines one at a time (the login button condition, the Setup registration gate, its step-up and switch gates, the hidden card, the refusal written as text, the users branch of the refusal, the no-reload rule, the modal cache refresh and its passkey condition) and each change made the targeted tests fail.Local checks on the final head, with the .NET 9.0.316 SDK pinned:
Checklist
dotnet build+dotnet testgreen)Screenshots / log slices
Additional notes
The full verification logs (the last run on this head, each new test failing against the code before its change, and the mutation runs) are in this secret gist: https://gist.github.com/camarigor/923cd82c97c0ece7e7d94508b5f183bc. I can test further changes.