Skip to content

Commit 3bb38cc

Browse files
phil198renetapopova
authored andcommitted
pr review comments
1 parent 303608b commit 3bb38cc

File tree

4 files changed

+29
-24
lines changed

4 files changed

+29
-24
lines changed

modules/ROOT/pages/authentication-authorization/auth-providers.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ Authentication and authorization can be controlled on a user-level using Cypher
99
In order to make use of Auth Providers, you need to set the `dbms.security.require_local_user` configuration setting to `true`.
1010
This setting mandates that only users with a corresponding Auth Provider in the database can authenticate and authorize.
1111

12-
Auth Providers give you a way to link externally-defined users (e.g. in a 3rd party ID provider like OIDC or LDAP) to the Neo4j internal User model. The internal model can define things such as roles (authorization), `SUSPENDED` status, `HOME DATABASE`, and metadata such as the unique displayed name of the user. For consistency you can also define `native` (password-based) auth using the Auth Provider syntax, including native-only users (i.e. users who can only authenticate with a password).
12+
Auth Providers give you a way to link externally-defined users (e.g. in a 3rd party ID provider like OIDC or LDAP) to the Neo4j internal User model.
13+
14+
The internal model can define things such as roles (authorization), `SUSPENDED` status, `HOME DATABASE`, and metadata such as the unique displayed name of the user.
15+
16+
For consistency you can also define `native` (password-based) auth using the Auth Provider syntax, including native-only users (i.e. users who can only authenticate with a password).
1317

1418
== Use Cases
1519
. Provisioning different auth providers (including native username/password auth) for different users.

modules/ROOT/pages/authentication-authorization/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ This is in contrast to a suspended user.
9494
This is a user who has been assigned the admin role.
9595

9696
[[term-auth-provider]]Auth Provider::
97-
A map attached to a database user which defines which authentication and authorization config to use for that user.
97+
Properties attached to a user which define which authentication and authorization config to use for that user.
9898

9999
[[term-authentication]]authentication::
100100
The process of verifying the identity of a user,

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ CREATE USER name [IF NOT EXISTS]
160160
SET AUTH [PROVIDER] 'provider' "{"
161161
{
162162
SET ID 'id' // a unique identifier of the user in an external system
163-
\| SET [PLAINTEXT \| ENCRYPTED] PASSWORD 'password'
164-
\| SET PASSWORD CHANGE [NOT] REQUIRED
163+
\| SET [PLAINTEXT \| ENCRYPTED] PASSWORD 'password' // PASSWORD clauses are only applicable to the 'native' provider
164+
\| SET PASSWORD CHANGE [NOT] REQUIRED // PASSWORD clauses are only applicable to the 'native' provider
165165
}
166166
"}"
167167
----
@@ -210,8 +210,8 @@ CREATE OR REPLACE USER name
210210
SET AUTH [PROVIDER] 'provider' "{"
211211
{
212212
SET ID 'id' // a unique identifier of the user in an external system
213-
\| SET [PLAINTEXT \| ENCRYPTED] PASSWORD 'password'
214-
\| SET PASSWORD CHANGE [NOT] REQUIRED
213+
\| SET [PLAINTEXT \| ENCRYPTED] PASSWORD 'password' // PASSWORD clauses are only applicable to the 'native' provider
214+
\| SET PASSWORD CHANGE [NOT] REQUIRED // PASSWORD clauses are only applicable to the 'native' provider
215215
}
216216
"}"
217217
----
@@ -297,8 +297,8 @@ ALTER USER name [IF EXISTS]
297297
SET AUTH [PROVIDER] 'provider' "{"
298298
{
299299
SET ID 'id' // a unique identifier of the user in an external system
300-
\| SET [PLAINTEXT \| ENCRYPTED] PASSWORD 'password'
301-
\| SET PASSWORD CHANGE [NOT] REQUIRED
300+
\| SET [PLAINTEXT \| ENCRYPTED] PASSWORD 'password' // PASSWORD clauses are only applicable to the 'native' provider
301+
\| SET PASSWORD CHANGE [NOT] REQUIRED // PASSWORD clauses are only applicable to the 'native' provider
302302
}
303303
"}"
304304
----
@@ -551,7 +551,7 @@ SHOW USERS
551551
|===
552552

553553
When first starting a Neo4j DBMS, there is always a single default user `neo4j` with administrative privileges.
554-
It is possible to set the initial password using xref:configuration/set-initial-password[`neo4j-admin dbms set-initial-password <password>`], otherwise it is necessary to change the password after the first login.
554+
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.
555555

556556
.Show user
557557
======
@@ -620,8 +620,8 @@ For both `CREATE` and `CREATE OR REPLACE`, `<key><value>` pairs for the `SET AUT
620620
SET AUTH [PROVIDER] 'provider' "{"
621621
{
622622
SET ID 'id' // a unique identifier of the user in an external system
623-
\| SET [PLAINTEXT \| ENCRYPTED] PASSWORD 'password'
624-
\| SET PASSWORD CHANGE [NOT] REQUIRED
623+
\| SET [PLAINTEXT \| ENCRYPTED] PASSWORD 'password' // PASSWORD clauses are only applicable to the 'native' provider
624+
\| SET PASSWORD CHANGE [NOT] REQUIRED // PASSWORD clauses are only applicable to the 'native' provider
625625
}
626626
"}"
627627
----
@@ -829,8 +829,8 @@ ALTER USER name [IF EXISTS]
829829
SET AUTH [PROVIDER] 'provider' "{"
830830
{
831831
SET ID 'id' // a unique identifier of the user in an external system
832-
\| SET [PLAINTEXT \| ENCRYPTED] PASSWORD 'password'
833-
\| SET PASSWORD CHANGE [NOT] REQUIRED
832+
\| SET [PLAINTEXT \| ENCRYPTED] PASSWORD 'password' // PASSWORD clauses are only applicable to the 'native' provider
833+
\| SET PASSWORD CHANGE [NOT] REQUIRED // PASSWORD clauses are only applicable to the 'native' provider
834834
}
835835
"}"
836836
----

modules/ROOT/pages/tutorial/tutorial-sso-configuration.adoc

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ For example to create a user `jake` who can authenticate and authorize using Ent
334334
----
335335
CREATE USER jake
336336
SET HOME DATABASE 'jakesHomeDb'
337-
SET AUTH 'oidc-okta' {SET ID 'jakesUniqueEntraUserId'} // `jakesUniqueEntraUserId` must match the value of the claim that you configured via dbms.security.oidc.azure.claims.username
337+
SET AUTH 'oidc-azure' {SET ID 'jakesUniqueAzureUserId'} // `jakesUniqueAzureUserId` must match the value of the claim that you configured via dbms.security.oidc.azure.claims.username
338338
----
339339

340340
See xref:authentication-authorization/sso-integration.adoc#auth-sso-auth-providers[SSO integration] for further examples.
@@ -375,9 +375,14 @@ dbms.security.oidc.google.config=token_type_principal=id_token;token_type_authen
375375

376376
There are then two ways to create the user in the database (which is required to give the users roles from native authorization):
377377

378-
. Using Auth Providers
379-
xref:authentication-authorization/auth-providers.adoc[Auth Providers] allow us to specify auth providers at the user-level which is useful in this scenario.
380-
This approach allows us to have an `admin` user who can authenticate natively, and can then create less privileged users who may only authenticate using `oidc-google` and will receive the roles granted to them using `native` authorization.
378+
. Using Auth Providers.
379+
xref:authentication-authorization/auth-providers.adoc[Auth Providers] allow us to specify authentication and authorization providers at the user-level which is useful in this scenario.
380+
This approach relies on the existence of an `admin` user who can authenticate natively, and can themselves create less privileged users who may only authenticate using `oidc-google` and who will receive the roles granted to them using `native` authorization.
381+
382+
[NOTE]
383+
====
384+
An admin user with the name `neo4j` is created by default when the database is xref:configuration/set-initial-password.adoc[first started].
385+
====
381386

382387
.. Change the configuration to allow `native` authentication (for use only by the `admin` user):
383388

@@ -387,7 +392,7 @@ dbms.security.authentication_providers=oidc-google, native
387392
----
388393

389394
.. Set the `dbms.security.require_local_user` configuration setting to `true` in the _neo4j.conf_ file.
390-
This will switch to User Auth Providers mode whereby users can only authenticate and authorize if they have a corresponding Auth Provider in the database.
395+
This will switch to __User Auth Providers__ mode whereby users can only authenticate and authorize if they have a corresponding Auth Provider in the database.
391396

392397
[source, properties]
393398
----
@@ -411,9 +416,9 @@ SET AUTH 'oidc-google' {SET ID 'jakesUniqueGoogleUserId'} // `jakesUniqueGoogleU
411416
GRANT ROLE reader TO jake
412417
----
413418

414-
The user will implicitly receive `native` authorization because `native` is in the list of authorization providers and you have explicitly granted the user a `ROLE`.
419+
The user will implicitly receive `native` authorization because `native` is in the list of authorization providers and you have explicitly granted the user a role.
415420

416-
You can now disable native authentication for the database completely:
421+
Once you have set up your users in this way, you can now disable native authentication for the database completely:
417422

418423
[source, properties]
419424
----
@@ -466,10 +471,6 @@ REQUIRED
466471
GRANT ROLE reader TO jakesUniqueGoogleUserId
467472
----
468473

469-
470-
471-
472-
473474
== FAQ
474475

475476
=== When should `pkce` be used as auth flow?

0 commit comments

Comments
 (0)