Authentication, users, and groups
This area answers two management questions: how people prove who they are, and how Opfield limits what they can change. The identity owner maintains sign-in and recovery; resource owners define operational groups; security administrators review privileged access. Success means people can recover access without bypassing controls, and a role change can be applied and audited without rewriting every resource.
Opfield supports independent OIDC, including the Opfield account, local-password, and email one-time-code authentication. Passkeys are enrolled after account creation. MFA policy can require enrollment before a user receives a normal session. Sign-in methods, multi-factor authentication, the OIDC provider, and identity provisioning are configured under Settings > Authentication.
Use groups as the normal permission boundary. Keep a small, auditable administrator group and separate operators, developers, observers, and automation. Blocking or deleting a user revokes access while preserving historical attribution. Restoring a deleted user leaves the account blocked until explicitly enabled.
Impersonation is an administrative support flow and must remain distinguishable in session purpose and audit records. Stop impersonation to restore the original administrator session; do not issue normal API tokens from an impersonated session.
Opfield does not provide SCIM yet. SCIM support is planned; until it arrives, use the supported administration API with scoped OAuth automation when your identity system can call external APIs, or maintain a documented manual process.


Authentication design
Section titled “Authentication design”Enable at least two administrator recovery paths before depending on an external identity provider. Test OIDC redirect and logout behavior, email delivery, local-password recovery, MFA enrollment, and recovery codes with non-production accounts.
OIDC proves identity but does not automatically grant broad product access. Opfield permissions remain explicit. If the external provider is unavailable, only independently configured methods can restore access.
Connect your SSO provider (OIDC)
Section titled “Connect your SSO provider (OIDC)”Opfield signs users in through one OIDC provider per installation, such as Keycloak, Authentik, Microsoft Entra ID, Okta, or Google Workspace. Changing the provider, the sign-in methods, OIDC user auto-creation and its default group, or relaxing Require verified OIDC email needs settings:opfield:edit and admin:system. Resubmitting their current values needs no admin:system.
Before you start, check that Public URL in Settings > General is the address users open, for example https://opfield.example.com. The redirect URI is built from it.
-
Register Opfield in the identity provider. Create an OpenID Connect web application (a confidential client with the authorization code flow). Register the redirect URI
<Public URL>/auth/callback, for examplehttps://opfield.example.com/auth/callback. Scheme, hostname, port, and path must match exactly. Note the issuer URL, the client ID, and the client secret. -
Fill in the provider. Open Settings > Authentication > OIDC provider:
Field What to enter Display name The name on the sign-in button: Sign in with this name. Leave it empty to show Sign in with SSO. Issuer URL The provider’s issuer, for example https://id.example.com/application/o/opfield/. Opfield reads the discovery document from it to find the authorization, token, and key endpoints.Client ID The client identifier from step 1. Client secret The secret from step 1. Opfield stores it encrypted and later shows only its last four characters. When editing, leave it empty to keep the stored secret. Redirect URI The same callback you registered in step 1: <Public URL>/auth/callback.Scopes Space-separated; openidis required. The defaultopenid email profilegives Opfield the user’s email and name.Press Save.
-
Decide how accounts appear. In Settings > Authentication > Identity provisioning:
- Auto-create users on OIDC sign-in creates an Opfield account the first time a user signs in through the provider. Turn it off when every user must be created first in Administration > Users with the sign-in method OIDC; their first OIDC sign-in with the same email claims that account.
- Require verified OIDC email accepts the email only when the provider sends
email_verified: true. - Default group for new OIDC users is the group auto-created users receive.
-
Turn OIDC on. In Settings > Authentication > Sign-in methods, switch on OIDC. Opfield refuses it with
OIDC_NOT_CONFIGUREDuntil the provider is saved. -
Test sign-in. Keep your current session open. In a private window, open Opfield, choose Sign in with your display name, and sign in with a test account. Check that the user lands in the expected group, then sign in once as an administrator through the provider.
-
Move administrators. In Administration > Users > Configure User, set Sign-in method to OIDC for each administrator who should use the provider. Changing the method signs the user out everywhere; the account is linked to the provider on its next sign-in.
-
Switch other methods off if you want. Only after an administrator has signed in through the provider, turn off Email and password or Email sign-in code in Sign-in methods.
What Opfield reads from the provider
Section titled “What Opfield reads from the provider”| Claim | Use |
|---|---|
sub |
The user’s identity at the provider. Together with the issuer it links the Opfield account. Required. |
email |
Matches a user created in advance and becomes the account’s email. Required on the first sign-in. |
email_verified |
Checked when Require verified OIDC email is on. |
name |
The user’s name in Opfield. Names of OIDC users are managed by the provider and cannot be edited in Opfield. |
picture |
The user’s avatar. |
Opfield does not map provider groups or roles. Groups and scopes are assigned in Opfield; new users get the default group.
A user who has signed in through a provider stays linked to its issuer. If you change Issuer URL to another provider, such users cannot sign in through the new one (OIDC_ISSUER_MISMATCH). To move such a user, switch their Sign-in method in Configure User to another method and back to OIDC; they are linked again on their next sign-in.
Remove in the OIDC provider panel deletes the provider after a confirmation and turns OIDC sign-in off.
API: PUT /api/admin/auth-settings with oidc (issuer, clientId, clientSecret, redirectUri, scopes, displayName), methods, or oidcProviderAction: "remove"; MCP and assistant: update_opfield_settings with the same fields.
Sign in with the Opfield account
Section titled “Sign in with the Opfield account”An installation connected to Opfield Cloud can use your Opfield account as its OIDC provider instead of registering its own SSO. Opfield asks the account for a sign-in client; you do not enter an issuer, client ID, or secret. Allow remote management is not needed.
- Check that Public URL in Settings > General is set. The account sends users back to
<Public URL>/auth/callback; without a public URL the request is refused withPUBLIC_URL_REQUIRED. - In Settings > Authentication > OIDC provider, choose Use Opfield account. The panel shows “Waiting for your Opfield account… Sign-in with it is set up as soon as it answers” and a Cancel request button. Choosing the button again does not send a second request.
- When the account answers, Opfield adds the provider “Opfield account” and turns OIDC on in Sign-in methods. The installation has one OIDC provider, so the Opfield account takes the place of the provider you had. The panel updates by itself.
- Let people sign in with it. Users are matched as with any OIDC provider: give an existing user the Sign-in method OIDC in Configure User, and their first sign-in with the Opfield account of the same email claims the account; new users are created when Auto-create users on OIDC sign-in is on. Test it in a private window with Sign in with Opfield account.
Cancel request withdraws a request the account has not answered yet. If switching to the Opfield account would leave no administrator able to sign in, Opfield only keeps the client it received and changes nothing; give an administrator a method that stays on, then choose Use Opfield account again. Once the installation has a client, Use Opfield account brings the provider back at once, for example after you removed it or tried your own SSO.
When someone loses access to the installation in the Opfield account, Opfield blocks their user, and Administration > Users shows Blocked by the Opfield account. Their next sign-in with the Opfield account, once the account gives the access back, unblocks them; Unblock user works too. See Access removed in the Opfield account.
The Opfield account can replace the client secret over the connection while the installation signs in with the “Opfield account” provider. When you disconnect the installation from Opfield Cloud, or the account disconnects it, Opfield forgets the client, removes the “Opfield account” provider, and turns OIDC sign-in off. If no administrator could sign in then, the provider stays and the OIDC provider panel says so: give an administrator another sign-in method, then choose Remove.
API: PUT /api/admin/auth-settings with oidcProviderAction: "opfield_account" or "cancel_opfield_account"; MCP and assistant: update_opfield_settings with the same field. The settings report opfieldAccountSignIn with available (connected to Opfield Cloud), clientIssued, pendingRequest, and detached. Without a connection the action is refused with OPFIELD_ACCOUNT_CLIENT_MISSING.
Password and email-code sign-in
Section titled “Password and email-code sign-in”Email and password and Email sign-in code in Sign-in methods send links and codes over email, so they need a verified SMTP in Settings > Advanced > SMTP configuration: send a test there first. Without it, turning either method on is refused with SMTP_NOT_VERIFIED. An installation set up with Password + authenticator app runs password sign-in without SMTP, and its administrators recover with Admin recovery sign-in instead of a reset email. A user’s own method is set in Administration > Users > Configure User > Sign-in method; switching to Email and password sends a password setup link. Changing a user’s sign-in method needs only user administration and keeps their second factors.
Sign-in limits and sessions
Section titled “Sign-in limits and sessions”Password, email-code, and second-factor checks are limited per account on top of the per-address request limit. Ten failures of one account from one client address within 15 minutes lock that account for that address for 15 minutes, and 100 failures from all addresses together lock the account everywhere for 15 minutes. A browser that signed in to the account before carries a known-device cookie for 30 days and is not held by the account-wide lock. Each authenticator code works once.
HTTPS consoles use a host-only session cookie. Absolute session lifetime in Settings > Environment, off by default, ends a session after a fixed time however active it is; changing it, and the MFA grace period, needs admin:system.
The last administrator keeps a way in
Section titled “The last administrator keeps a way in”Opfield refuses a change after which no system administrator could sign in. It checks this when you turn OIDC, Email and password, or Email sign-in code off, remove the OIDC provider, or save a provider with another issuer. The change is refused with LAST_ADMIN_SIGN_IN: “No administrator could sign in after this change.” An administrator counts only when their own sign-in method stays on, and for OIDC only when they are not linked to a different issuer. Passkeys do not count. Give another administrator, or yourself, a method that stays on, sign in with it, and then make the change.
On an installation managed by Opfield Cloud, the provider starts as “Opfield account” and follows the same rules; see Managed installations.
User lifecycle
Section titled “User lifecycle”- Create or invite the user through an approved authentication path.
- Require MFA according to policy before granting sensitive scopes.
- Add the user to role-based groups rather than assigning one-off permissions where possible.
- Verify the user can access one intended resource and is denied one out-of-scope resource.
- Review sessions, tokens, and group membership when the user’s role changes.
- Block the account immediately when access must stop.
- Delete only after ownership and automation dependencies are transferred.
Blocking stops new use without erasing attribution. Deletion remains visible in audit history. Restoring a deleted record does not silently reactivate it.
Invitation emails
Section titled “Invitation emails”An invitation email tells a new user that an administrator created their Opfield account and links to the sign-in page, with one hint for their sign-in method: the identity provider, an email code, or the separate email that sets their password. Sending needs verified SMTP and the Opfield public URL.
- Send invitation email in Administration > Users > Configure User, in the Account panel, sends it by hand. It is offered once per user and only until their first sign-in; after sending, the panel shows when it was sent. It needs
admin:userson that user. - Settings > Authentication > Identity provisioning > Send an invitation email when an account is created sends it for every account created in the Console, the API, or MCP. It is off by default and needs
settings:opfield:editto change. If sending fails, the account is still created and the invitation can be sent later by hand.
API: POST /api/admin/users/{id}/invitation; MCP and assistant: manage_user operation send_invitation. The user list returns lastLoginAt and invitationSentAt for each user.
Group design
Section titled “Group design”Separate platform administration, security administration, application operation, development, read-only observation, and automation. Use resource-scoped grants for one folder, Route, Node, workload, database, or Pages Project instead of granting an entire product area.
The group dialog and a user’s additional permissions show access as a list of lines. Add Access adds one: a Role, Where it applies (Everywhere, In a project folder, In an app environment, or Specific resources), and what it Covers, or an access level on Git repositories. Review N scopes opens the scopes themselves; each section header there shows where the section’s scopes reach (Everywhere, one place, or N places) and limits them to folders, apps, or environments. See Restrict tokens and OAuth grants.
Keep the administrator group small and maintain a documented break-glass path. Test permission changes with a real non-admin session; an administrator view cannot prove that deny boundaries work.
Impersonation and support
Section titled “Impersonation and support”Use impersonation only for a bounded support investigation. The session must remain visibly marked and auditable. Do not change credentials, create durable administrator tokens, or perform unrelated work while impersonating another user. Stop impersonation before returning to normal administration.
Provisioning before SCIM
Section titled “Provisioning before SCIM”SCIM provisioning is not available yet and no release date is guaranteed. Until it is released, keep a joiner/mover/leaver checklist and reconcile users and groups manually or through supported REST API and OAuth automation. Give the automation client only the user and group scopes it needs, make requests idempotent, and verify one expected grant and one expected denial after every access change.
Recovery and lockout prevention
Section titled “Recovery and lockout prevention”Treat identity configuration as a production dependency. Before changing the only working sign-in method, create and test a second administrator path in a separate browser profile. Keep recovery codes outside Opfield, verify that local-password recovery email reaches the intended mailbox, and record which team owns the OIDC application and its client secret. Do not disable the previous method until a fresh session can sign in, complete MFA, and reach an administrator-only page through the replacement path.
If administrators are locked out, restore the failed external dependency, use the previously tested independent method, or run Admin recovery sign-in on the host. Avoid editing user, session, or group rows directly in PostgreSQL: bypassing the application can leave password, MFA, session, and audit state inconsistent. After access returns, review recent authentication events, active sessions, group membership, and recovery-code status before treating the incident as closed.
Admin recovery sign-in
Section titled “Admin recovery sign-in”An administrator who cannot sign in, because of a lost authenticator app and recovery codes, a broken OIDC provider, or an unreachable Opfield account, gets a one-time link on the Opfield host:
cd /opt/opfield && docker compose exec app node dist/cli/admin-recovery-link.jscd /opt/opfield && docker compose exec app node dist/cli/admin-recovery-link.js --email [email protected]Without --email the link is for the owner; --email names another system administrator. The link works once and for 30 minutes, and only the hash of its secret is stored. Opening it and choosing Sign in signs the administrator in without their usual provider or second factor and opens Profile at Account security, where they can replace the authenticator app, regenerate recovery codes, or add a passkey without a step-up for 30 minutes. An OIDC administrator fixes the provider in Settings > Authentication. The audit log records Signed in with a recovery link (auth.recovery_sign_in). Anyone with shell access to the host can run the command, which matches the existing trust boundary.
Verification checklist
Section titled “Verification checklist”- Sign in through every enabled method with a non-production account.
- Confirm MFA enrollment is enforced before a normal privileged session is issued.
- Verify a blocked user cannot create a new session or use an existing token.
- Verify a restored user remains blocked until explicitly enabled.
- Test one allowed and one denied resource action for each operational group.
- Confirm impersonation is visibly marked and the audit actor remains attributable.
- Reconcile inactive users, unused groups, stale sessions, and outstanding invitations on a schedule.
Authentication proves who the caller is; groups and scopes decide what that caller may do. A successful OIDC login must never be used as evidence that the user should receive broad Opfield authority.