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. Rotation is detected with an opaque change token stored on status.passwordSecretHash; the token is derived from the Secret's namespace, name, key and resourceVersion — not from the password value — so neither the password nor a hash of it is ever written to the CR.
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.
Required. Name of the Neo4jEnterpriseCluster or Neo4jEnterpriseStandalone in the same namespace. In-database users are not managed on Neo4j Aura — use Aura IAM / console-RBAC instead.
username
string
Username in Neo4j. Defaults to metadata.name. Pattern ^[a-zA-Z][a-zA-Z0-9_.@\-]*$ (the at-sign supports email-style SSO/LDAP usernames), max 65 characters.
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.
Key inside the Secret's data. There is no schema-level default; the controller falls back to password when this is empty. Empty values at the resolved key are rejected.
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).
Short human-readable summary of the current phase.
observedGeneration
int64
metadata.generation observed during the last reconcile.
currentRoles
[]string
Roles currently granted to the user, as observed via SHOW USERS YIELD roles.
passwordSecretHash
string
Opaque change-detection token for the password Secret last applied: a SHA-256 of the Secret's namespace, name, key and resourceVersion (never of the password). Any write to the Secret changes it, so a cosmetic edit triggers one harmless no-op password re-apply. The field name is kept for API compatibility.
passwordLastRotated
time
Last time ALTER USER ... SET PASSWORD was executed.
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_.@\-]*$ (the at-sign supports email-style SSO/LDAP usernames), max 65 characters.
The reserved name system is rejected. The default bootstrap admin name neo4j is allowed with a warning: the operator authenticates as it, so managing it rewrites the credential in the cluster's admin Secret and can lock the operator out.
At least one of passwordSecretRef or externalAuth must be set (Neo4j requires ≥1 auth provider per user).
passwordSecretRef: the Secret must contain a non-empty value at the named key. A Secret that does not exist yet is not an error — the user waits in phase Pending (reason SecretPending) and retries. 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.