Skip to content

Commit 340488f

Browse files
phil198renetapopova
authored andcommitted
adding SHOW USERS WITH AUTH description
1 parent c0cef00 commit 340488f

File tree

3 files changed

+111
-5
lines changed

3 files changed

+111
-5
lines changed

modules/ROOT/pages/authentication-authorization/dbms-administration.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,12 @@ GRANT [IMMUTABLE] SET PASSWORD[S]
466466
TO role[, ...]
467467
| Enables the specified roles to modify users' passwords and whether those passwords must be changed upon first login.
468468

469+
| [source, syntax, role=noheader]
470+
GRANT [IMMUTABLE] SET AUTH
471+
ON DBMS
472+
TO role[, ...]
473+
| Enables the specified roles to SET or REMOVE users' xref:authentication-authorization/auth-providers.adoc[Auth Providers].
474+
469475
| [source, syntax, role=noheader]
470476
GRANT [IMMUTABLE] SET USER HOME DATABASE
471477
ON DBMS

modules/ROOT/pages/authentication-authorization/manage-roles.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ Users can be given access rights by assigning them roles using `GRANT ROLE`:
597597
GRANT ROLE myrole TO bob
598598
----
599599

600-
The roles assigned to each user can be seen on the list provided by `SHOW USERS`:
600+
The roles assigned to each user can be seen on the list provided by xref:authentication-authorization/manage-users.adoc#access-control-list-users[`SHOW USERS`]:
601601

602602
[source, cypher, role=noplay]
603603
----

modules/ROOT/pages/authentication-authorization/manage-users.adoc

Lines changed: 104 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ a|
7171
[source, syntax, role="noheader"]
7272
----
7373
SHOW USER[S]
74+
[WITH AUTH]
7475
[YIELD { * \| field[, ...] } [ORDER BY field[, ...]] [SKIP n] [LIMIT n]]
7576
[WHERE expression]
7677
[RETURN field[, ...] [ORDER BY field[, ...]] [SKIP n] [LIMIT n]]
@@ -329,6 +330,11 @@ GRANT SET USER STATUS
329330
GRANT SET USER HOME DATABASE
330331
----
331332

333+
[source, privilege, role="noheader"]
334+
----
335+
GRANT SET AUTH
336+
----
337+
332338
(see xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-user-management[DBMS USER MANAGEMENT privileges])
333339

334340
|===
@@ -479,7 +485,7 @@ This command is only supported for a logged-in user and will return an empty res
479485
[[access-control-list-users]]
480486
== Listing users
481487

482-
Available users can be seen using `SHOW USERS`, which will produce a table of users with the following columns:
488+
Available users can be seen using `SHOW USERS`, which will produce a table containing a single row per user with the following columns:
483489

484490
[options="header", width="100%", cols="2a,4,2m,^.^,^.^"]
485491
|===
@@ -496,15 +502,19 @@ Available users can be seen using `SHOW USERS`, which will produce a table of us
496502
| {check-mark}
497503

498504
| roles
499-
| Roles granted to the user.
505+
| Native roles granted to the user using the `GRANT ROLE` command.
506+
507+
This is not necessarily the set of roles that a user will receive in practice. The latter depends on DMBS configuration as well as the user's xref:authentication-authorization/auth-providers.adoc[Auth Providers].
508+
509+
Examples of where a user would receive a different set of roles from that which appears in this column would include cases where they use external (e.g. LDAP or OIDC) auth, or where they do not have the `native` xref:authentication-authorization/auth-providers.adoc[Auth Provider].
500510

501511
Will return `null` in community edition.
502512
| LIST OF STRING
503513
| {cross-mark}
504514
| {check-mark}
505515

506516
| passwordChangeRequired
507-
| If `true`, the user must change their password at the next login.
517+
| If `true`, the user must change their password at the next login. This will be null if the user has `native` auth disabled.
508518
| BOOLEAN
509519
| {check-mark}
510520
| {check-mark}
@@ -528,6 +538,7 @@ Will return `null` in community edition.
528538
| {check-mark}
529539
|===
530540

541+
531542
[source, cypher, role=noplay]
532543
----
533544
SHOW USERS
@@ -547,12 +558,91 @@ SHOW USERS
547558
|false
548559
|false
549560
|<null>
561+
|"jake"
562+
|["PUBLIC"]
563+
|false
564+
|false
565+
|<null>
566+
5+a|Rows: 2
567+
|===
550568

551-
5+a|Rows: 1
569+
To inspect users' xref:authentication-authorization/auth-providers.adoc[Auth Providers], use `SHOW USERS WITH AUTH`. This command will produce a row per user per Auth Provider and will yield the following two columns in addition to those output by `SHOW USERS`:
570+
571+
[options="header", width="100%", cols="2a,4,2m,^.^,^.^"]
572+
|===
573+
| Column
574+
| Description
575+
| Type
576+
| Community Edition
577+
| Enterprise Edition
578+
579+
| provider
580+
| The name of the auth provider.
581+
| STRING
582+
| {check-mark}
583+
| {check-mark}
584+
585+
| auth
586+
| A map containing configuration for the user. E.g. dn of the user for an `ldap` auth provider, the unique external identifier for an `oidc` auth provider, or password status for a native auth provider.
587+
588+
| MAP
589+
| {check-mark}
590+
| {check-mark}
591+
|===
592+
593+
594+
[source, cypher, role=noplay]
595+
----
596+
SHOW USERS WITH AUTH
597+
----
598+
599+
.Result
600+
[role="queryresult" options="header,footer", width="100%", cols="2m,3m,3m,2m,2m,3m,4m"]
601+
|===
602+
|user
603+
|roles
604+
|passwordChangeRequired
605+
|suspended
606+
|home
607+
|provider
608+
|auth
609+
|"neo4j"
610+
|["admin","PUBLIC"]
611+
|false
612+
|false
613+
|<null>
614+
|"native"
615+
|{
616+
"password": "***",
617+
"changeRequired": false
618+
}
619+
|"jack"
620+
|["PUBLIC"]
621+
|false
622+
|false
623+
|<null>
624+
|"native"
625+
|{
626+
"password": "***",
627+
"changeRequired": false
628+
}
629+
|"jack"
630+
|["PUBLIC"]
631+
|false
632+
|false
633+
|<null>
634+
|"oidc1"
635+
|{
636+
"id": "jacksIdForOidc1"
637+
}
638+
7+a|Rows: 1
552639
|===
553640

641+
[NOTE]
642+
====
554643
When first starting a Neo4j DBMS, there is always a single default user `neo4j` with administrative privileges.
555644
It is possible to set the initial password using xref:configuration/set-initial-password.adoc[`neo4j-admin dbms set-initial-password <password>`], otherwise it is necessary to change the password after the first login.
645+
====
556646

557647
.Show user
558648
======
@@ -581,6 +671,16 @@ RETURN user AS adminUser
581671
----
582672
======
583673

674+
.Show user with auth
675+
======
676+
Show all of the users with the `oidc` Auth Provider.
677+
[source,cypher,role=noplay]
678+
----
679+
SHOW USERS WITH AUTH
680+
WHERE provider = 'oidc1'
681+
----
682+
======
683+
584684
[NOTE]
585685
====
586686
The `SHOW USER name PRIVILEGES` command is described in xref:authentication-authorization/manage-privileges.adoc#access-control-list-privileges[Listing privileges].

0 commit comments

Comments
 (0)