Skip to content
Merged
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"revision": "cf5d430e08bbf554e6b2b0b1059724253fda155248f66d6f39edea8465e248c7",
"revision": "7adbf3cc98d9654da106868d0c95ee6205d4a822876cd50b9d27015adad0f691",
"state": "available",
"available": true,
"identities": true,
Expand All @@ -9,5 +9,6 @@
"live_provider_changes": true,
"provider_recheck": true,
"credentials_linking": true,
"network_sign_in": true
"network_sign_in": true,
"network_link_keeps_password": true
}
11 changes: 8 additions & 3 deletions contracts/api/v2/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -27287,6 +27287,10 @@
"description": "Whether auth binding and auth plugin changes apply without a server restart",
"type": "boolean"
},
"network_link_keeps_password": {
"description": "Whether linking a network identity (linkAccountIdentityWithNetwork, or createAdminUserIdentity at a network provider) keeps the account's local password sign-in. While the provider's latest answer refuses the person, that password is refused with not_permitted (break-glass accounts excepted); an unavailable or unsupported answer keeps the refusal, and it ends when the provider vouches again or the network provider is turned off. Servers without the field turn local password sign-in off on such a link. network_sign_in says whether the link operations are served",
"type": "boolean"
},
"network_sign_in": {
"description": "Whether signInWithNetworkIdentity and linkAccountIdentityWithNetwork are served. Whether a given request may use them is answered by listAuthProviders, which lists a network provider only to a request that arrived through that provider's network",
"type": "boolean"
Expand Down Expand Up @@ -27320,6 +27324,7 @@
"provider_recheck",
"credentials_linking",
"network_sign_in",
"network_link_keeps_password",
"revision",
"state"
],
Expand Down Expand Up @@ -49377,7 +49382,7 @@
},
"/api/v2/account/identities/link-network": {
"post": {
"description": "Only a request that arrived through the network identity provider's own network address can link: the provider's plugin says who owns the device that sent it, and that identity is linked to this account after the account re-enters its local password, with the same rules as other linking (local password sign-in turns off unless the account is break-glass; audited). listAuthProviders lists the provider, with the device owner's name, only to such a request. Answers 201 with the linked identity as listAccountIdentities shows it. Refusals, by problem type: 403 network_identity_required (the request did not come through that provider's network); 422 validation_failed at body.password (wrong local password); 409 local_password_required; 403 not_permitted (the provider refuses this device, for example a tagged device or one its policy leaves out); 403 permission_denied (the Silo account is disabled, or the caller is an API key or impersonation session); 409 identity_linked_elsewhere; 409 already_linked; 404 not_found (not an enabled network identity provider); 503 provider_unavailable. Spends the login rate-limit budget. getExternalSignInCapabilities reports network_sign_in.",
"description": "Only a request that arrived through the network identity provider's own network address can link: the provider's plugin says who owns the device that sent it, and that identity is linked to this account after the account re-enters its local password, with the same rules as other linking except one: the account keeps its local password sign-in (audited). While the provider refuses the person at a re-check, that password is refused with not_permitted too, except for a break-glass account; an unavailable or unsupported answer keeps the refusal, which ends when the provider vouches for the person again or the network provider is turned off. listAuthProviders lists the provider, with the device owner's name, only to such a request. Answers 201 with the linked identity as listAccountIdentities shows it. Refusals, by problem type: 403 network_identity_required (the request did not come through that provider's network); 422 validation_failed at body.password (wrong local password); 409 local_password_required; 403 not_permitted (the provider refuses this device, for example a tagged device or one its policy leaves out); 403 permission_denied (the Silo account is disabled, or the caller is an API key or impersonation session); 409 identity_linked_elsewhere; 409 already_linked; 404 not_found (not an enabled network identity provider); 503 provider_unavailable. Spends the login rate-limit budget. getExternalSignInCapabilities reports network_sign_in.",
"operationId": "linkAccountIdentityWithNetwork",
"requestBody": {
"content": {
Expand Down Expand Up @@ -116641,7 +116646,7 @@
"x-silo-service-backed": true
},
"post": {
"description": "The installation must have a sign-in binding. An identity linked to another account is 409 identity_linked_elsewhere; an account already linked to that installation is 409 already_linked. Linking turns the account's local password sign-in off unless it is a break-glass account. Only the server Owner may change another admin's sign-in.",
"description": "The installation must have a sign-in binding. An identity linked to another account is 409 identity_linked_elsewhere; an account already linked to that installation is 409 already_linked. Linking turns the account's local password sign-in off unless it is a break-glass account or the installation is a network identity provider. Only the server Owner may change another admin's sign-in.",
"operationId": "createAdminUserIdentity",
"parameters": [
{
Expand Down Expand Up @@ -116857,7 +116862,7 @@
},
"/api/v2/admin/users/{id}/identities/{identity_id}": {
"delete": {
"description": "The account may be left without a way to sign in: an account linked to a provider has local password sign-in off. Setting a password with updateAdminUser turns it back on. Only the server Owner may change another admin's sign-in.",
"description": "The account may be left without a way to sign in: an account linked to an OIDC or LDAP provider has local password sign-in off. Setting a password with updateAdminUser turns it back on. Only the server Owner may change another admin's sign-in.",
"operationId": "deleteAdminUserIdentity",
"parameters": [
{
Expand Down
26 changes: 24 additions & 2 deletions docs/architecture/external-sign-in.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ node create one account:
`access_denied`).

Linking by any path turns the account's local password sign-in off unless it
is a break-glass account.
is a break-glass account or the identity is a network identity. The OIDC or
LDAP provider then answers for the account, so a password must not outlive
the provider's removal of the person. A network identity keeps the password
and gates it instead ([Network identity](#network-identity)).

## Role sync

Expand Down Expand Up @@ -535,7 +538,26 @@ the SDK's `NetworkIdentityAuth`.
`POST /account/identities/link-network`) works like directory linking: the
account re-enters its local password, then the peer's identity is linked as
a linking flow. The owner of an existing account uses it, because a first
network sign-in would otherwise meet `email_in_use`.
network sign-in would otherwise meet `email_in_use`. Unlike directory
linking, the account keeps its local password sign-in and its open local
sessions stay local: the password still works where the overlay does not
reach (a public URL, Jellyfin-compatible apps). An account that network
sign-in created has no usable password until an administrator sets one.
- **The overlay still gates the password.** While an enabled network
provider's latest answer about the account's identity is a refusal
(`networkRefused`, `pending_refusal` included), every password surface
refuses the account with `not_permitted`, after checking the password;
break-glass accounts are exempt. The refusal itself ends every session and
API key of the account, as for any provider that answers for it. The block
lifts only when the provider vouches again, at a network sign-in or an
active re-check: an unavailable or unsupported answer keeps a refusal on
record as the identity's status (`recordIdentityCheck`);
the scheduled pass re-checks the network identity of an account with local
password sign-in on even when it holds no credential to bound, so a person
removed from the overlay is found and one added back is let in. It is not
the account's disabled flag, which stays the administrator's. To let a
person keep only their password, unlink the network identity; turning the
network provider off also lifts every block.
- **Re-check** is the ordinary provider re-check: the plugin answers
`CheckAccount` from its own view of the overlay (Tailscale: the person
still has an untagged device in the node's peer list, and still holds a
Expand Down
8 changes: 6 additions & 2 deletions docs/auth-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ public) reports which of these operations the server serves, including
`network_sign_in` (`signInWithNetworkIdentity` and
`linkAccountIdentityWithNetwork`; see
[Network identity](architecture/external-sign-in.md#network-identity)).
`network_link_keeps_password` says linking a network identity keeps the
account's local password sign-in; clients use it to describe what connecting
does, because servers without it turn the password off. It describes the
linking rule whether or not `network_sign_in` is served.

| Operation | Credential | Notes |
| --- | --- | --- |
Expand All @@ -289,11 +293,11 @@ public) reports which of these operations the server serves, including
| `POST /auth/login` (`login`) | none | Without `provider`, the name is routed: an account with local password sign-in signs in locally (and is refused with `local_login_disabled` while the server switch is off, never sent to the directory), any other name goes to the enabled LDAP plugin. |
| `GET /account/identities` (`listAccountIdentities`) | signed-in account | The caller's linked identities: provider, username, email, `linked_at`, `last_sign_in_at`, and `last_checked_at` (the provider's latest answer about the identity, from a sign-in or a re-check). |
| `POST /account/identities/link-credentials` (`linkAccountIdentityWithCredentials`) | the account's own login session | Links the directory (LDAP) identity. Body, all required and non-null: `installation_id` (the credentials provider from `listAuthProviders`), `password` (the account's local password, 1 to 1024 characters), `username` (directory username, 1 to 256) and `directory_password` (1 to 1024). Answers 201, `Location: /api/v2/account/identities`, and the linked identity as `listAccountIdentities` shows it. Refusals: 422 `validation_failed` at `body.password` (wrong local password) or `body.directory_password` (the directory refused the credentials); 409 `local_password_required`; 403 `not_permitted`, `account_disabled` (the directory account is disabled, locked or expired) or `password_expired`; 403 `permission_denied` (the Silo account is disabled, or an API key or impersonation session); 409 `identity_linked_elsewhere` or `already_linked`; 404 `not_found` (not an enabled credentials provider); 503 `provider_unavailable`; 429. Spends the `login` rate-limit budget. Linking turns local password sign-in off unless the account is break-glass. |
| `POST /account/identities/link-network` (`linkAccountIdentityWithNetwork`) | the account's own login session, through the network provider's overlay | Links the network identity of the requesting device. Body, required and non-null: `installation_id` (the network provider from `listAuthProviders`) and `password` (the account's local password). Answers 201 like `linkAccountIdentityWithCredentials`. Refusals: 403 `network_identity_required`, 422 `validation_failed` at `body.password`, 409 `local_password_required`, 403 `not_permitted`, 403 `permission_denied`, 409 `identity_linked_elsewhere` or `already_linked`, 404 `not_found`, 503 `provider_unavailable`, 429. Spends the `login` rate-limit budget. |
| `POST /account/identities/link-network` (`linkAccountIdentityWithNetwork`) | the account's own login session, through the network provider's overlay | Links the network identity of the requesting device. Body, required and non-null: `installation_id` (the network provider from `listAuthProviders`) and `password` (the account's local password). Answers 201 like `linkAccountIdentityWithCredentials`. Refusals: 403 `network_identity_required`, 422 `validation_failed` at `body.password`, 409 `local_password_required`, 403 `not_permitted`, 403 `permission_denied`, 409 `identity_linked_elsewhere` or `already_linked`, 404 `not_found`, 503 `provider_unavailable`, 429. Spends the `login` rate-limit budget. Unlike other linking, the account keeps its local password sign-in, which answers 403 `not_permitted` while the provider refuses the person (break-glass accounts excepted). |
| `DELETE /account/identities/{id}` (`deleteAccountIdentity`) | the account's own login session | Refused with 409 `last_sign_in_method` unless the account can still sign in with its local password or another identity. API keys and impersonation sessions get 403. |
| `GET /admin/users/{id}/identities` (`listAdminUserIdentities`) | acting admin | Adds `external_subject`, `issuer` and `last_check_status`: what the provider said at `last_checked_at` about the identity, from a sign-in or a re-check (`active`, `not_found`, `disabled`, `not_permitted`, `unsupported`, `unavailable`, or `none` before the first). |
| `POST /auth/refresh` (`refreshSession`) | the refresh token | A session opened through the provider is re-checked with it when due (see below). A refused account ends the session (401 `session_expired`). Under the `fail_closed` outage policy, an unreachable provider answers 503 `provider_unavailable`; the session stays valid and the client retries later. A database that cannot be read answers 503 `dependency_unavailable` with `Retry-After` (see [When the server cannot check a session](#when-the-server-cannot-check-a-session)). A provider answer the server received but could not apply, where a retry would not help, is 401 `invalid_token`: a refusal that could not be applied, a role sync that rolled back, or a replacement refresh token that could not be stored (the provider may accept only that token now). A refusal whose revocation rolled back stays on record and ends the session at the next check, and an unapplied active answer stays due. Any other database failure after an active answer is the retryable 503 above. |
| `POST /admin/users/{id}/identities` (`createAdminUserIdentity`) | acting admin | Links by `installation_id` and the exact `external_subject`. Turns local password sign-in off unless the account is break-glass. |
| `POST /admin/users/{id}/identities` (`createAdminUserIdentity`) | acting admin | Links by `installation_id` and the exact `external_subject`. Turns local password sign-in off unless the account is break-glass or the installation is a network identity provider. |
| `DELETE /admin/users/{id}/identities/{identity_id}` (`deleteAdminUserIdentity`) | acting admin | May leave the account without a sign-in method; setting a password with `updateAdminUser` turns its local password sign-in back on. |
| `PUT /admin/users/{id}` (`updateAdminUser`) | acting admin | `break_glass` sets or clears the flag: admin accounts only, and only the server Owner may change it (403 `permission_denied`). The Owner has it by default (set at first-run setup and on every ownership move) and may clear it on its own account. A `password` also turns the account's local password sign-in back on, so an admin other than the Owner may not set its own while its local sign-in is off (403 `permission_denied`; the v1 route answers `owner_protected`). Demoting, disabling or clearing the last usable break-glass admin while local sign-in is off is 409 `break_glass_required`; so is deleting it (`deleteAdminUser`) or turning `auth.local_password_login` off without one (`updateAdminSettings`, `updateAdminSetting`). |
| `POST /admin/plugins/installations/{id}/auth-binding/test` (`testAdminPluginAuthBinding`) | acting admin | Sends staged `config` entries (blank secrets keep the stored value) to the plugin's `TestConnection`; answers `ok`, the plugin's `steps` and `callback_url`, the redirect URI to register at an OAuth provider (empty without a public URL). A plugin without a connection test, or a disabled installation, is 409. Not retried automatically. |
Expand Down
5 changes: 3 additions & 2 deletions internal/apiv2/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ func registerAuth(reg *Registry) {
login := humaOp(http.MethodPost, Prefix+"/auth/login", "login", "auth",
"Authenticate with a username and password and open a login session.")
// Wrong credentials are 401 invalid_token; a disabled account, turned-off
// local password sign-in (local_login_disabled) or a directory refusal
// (not_permitted, password_expired) is 403, and so is a directory sign-in
// local password sign-in (local_login_disabled), a directory refusal
// (not_permitted, password_expired) or a network provider's refusal of
// the account's person (not_permitted) is 403, and so is a directory sign-in
// with no account while account creation is off (account_required); an
// account a directory sign-in cannot create or link is 409 (email_in_use,
// identity_linked_elsewhere).
Expand Down
Loading
Loading