The Neo4jUser Custom Resource Definition (CRD) provides declarative management of Neo4j users — username, password, account state, home database, role bindings, and external authentication providers — for both Neo4jEnterpriseCluster and Neo4jEnterpriseStandalone deployments.
Supported Neo4j Versions: 5.26 LTS and any CalVer release (2025.x, 2026.x, and onward) — Enterprise edition only (SET STATUS and external auth providers are Enterprise-only features)
Reconciliation: User existence, password (rotated via Secret hash), SET STATUS, SET HOME DATABASE, role bindings (GRANT/REVOKE ROLE), external auth providers (SET AUTH)
Privileges live on Neo4jRole, not on Neo4jUser. Bind users to roles; never inline grants on a user.
Passwords come from Secret, never from the spec. The Secret value is hashed (SHA-256) and stored on status.passwordSecretHash to detect rotation; the password itself is never echoed back.
Same-namespace clusterRef only. Cross-namespace references are rejected.
PUBLIC is implicit. It is auto-assigned by Neo4j and never granted/revoked by the controller. Listing it in spec.roles produces a warning.
References a Secret holding the native-auth password. Required unless one or more externalAuth entries are provided.
requirePasswordChange
boolean
Force password change on next login (SET PASSWORD CHANGE REQUIRED). Default false.
accountStatus
string
One of active (default), suspended. Maps to SET STATUS ACTIVE|SUSPENDED. Suspending a native user revokes role assignments client-side; reactivating restores them.
homeDatabase
string
Sets SET HOME DATABASE. Removing this field after it was set issues REMOVE HOME DATABASE.
roles
[]string
Role names to grant. Mix built-ins (reader, editor, publisher, architect, admin) and custom role names from Neo4jRole CRs. PUBLIC is implicit and need not be listed.
Configures a single non-native authentication provider for the user. The provider must already be configured at the DBMS level (dbms.security.authentication_providers etc.).
Field
Type
Description
provider
string
Required. Provider name, e.g. oidc-okta, ldap1, saml1. The literal native is rejected — use passwordSecretRef for native authentication.
id
string
Required. The user's identifier within that provider (e.g. an OIDC sub claim or an LDAP DN).
clusterRef must resolve to a Neo4jEnterpriseCluster or Neo4jEnterpriseStandalone in the same namespace.
username (or metadata.name fallback) matches ^[a-zA-Z][a-zA-Z0-9_.\-]*$, max 65 characters.
The reserved name system is rejected.
At least one of passwordSecretRef or externalAuth must be set (Neo4j requires ≥1 auth provider per user).
passwordSecretRef: the Secret must exist and contain a non-empty value at the named key. Values shorter than 8 characters produce a warning (Neo4j's default minimum is 8).
externalAuth[].provider cannot be native.
homeDatabase, when set, must be a valid Neo4j database name.
accountStatus must be one of active or suspended (enforced by kubebuilder enum).
deletionPolicy must be one of Delete or Retain (enforced by kubebuilder enum).
apiVersion:neo4j.neo4j.com/v1beta1kind:Neo4jUsermetadata:name:alicenamespace:prodspec:clusterRef:prod-clusterusername:aliceexternalAuth:-provider:oidc-oktaid:alice@example.com-provider:ldap1id:"uid=alice,ou=people,dc=example,dc=com"roles:[editor]# No passwordSecretRef — native auth is not enabled for this user.
apiVersion:neo4j.neo4j.com/v1beta1kind:Neo4jUsermetadata:name:analytics-readernamespace:prodspec:clusterRef:prod-clusterusername:analytics_readerpasswordSecretRef:name:analytics-reader-credsroles:-analytics_reader# corresponds to a Neo4jRole CR's spec.name
If the Neo4jRole does not yet exist, the user enters PendingDependencies and reconciles automatically when the role lands.