You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/ROOT/pages/authentication-authorization/auth-providers.adoc
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,11 @@ Authentication and authorization can be controlled on a user-level using Cypher
9
9
In order to make use of Auth Providers, you need to set the `dbms.security.require_local_user` configuration setting to `true`.
10
10
This setting mandates that only users with a corresponding Auth Provider in the database can authenticate and authorize.
11
11
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).
13
17
14
18
== Use Cases
15
19
. Provisioning different auth providers (including native username/password auth) for different users.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/authentication-authorization/manage-users.adoc
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,8 +160,8 @@ CREATE USER name [IF NOT EXISTS]
160
160
SET AUTH [PROVIDER] 'provider' "{"
161
161
{
162
162
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
165
165
}
166
166
"}"
167
167
----
@@ -210,8 +210,8 @@ CREATE OR REPLACE USER name
210
210
SET AUTH [PROVIDER] 'provider' "{"
211
211
{
212
212
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
215
215
}
216
216
"}"
217
217
----
@@ -297,8 +297,8 @@ ALTER USER name [IF EXISTS]
297
297
SET AUTH [PROVIDER] 'provider' "{"
298
298
{
299
299
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
302
302
}
303
303
"}"
304
304
----
@@ -551,7 +551,7 @@ SHOW USERS
551
551
|===
552
552
553
553
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.
555
555
556
556
.Show user
557
557
======
@@ -620,8 +620,8 @@ For both `CREATE` and `CREATE OR REPLACE`, `<key><value>` pairs for the `SET AUT
620
620
SET AUTH [PROVIDER] 'provider' "{"
621
621
{
622
622
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
625
625
}
626
626
"}"
627
627
----
@@ -829,8 +829,8 @@ ALTER USER name [IF EXISTS]
829
829
SET AUTH [PROVIDER] 'provider' "{"
830
830
{
831
831
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
Copy file name to clipboardExpand all lines: modules/ROOT/pages/tutorial/tutorial-sso-configuration.adoc
+12-11Lines changed: 12 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -334,7 +334,7 @@ For example to create a user `jake` who can authenticate and authorize using Ent
334
334
----
335
335
CREATE USER jake
336
336
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
338
338
----
339
339
340
340
See xref:authentication-authorization/sso-integration.adoc#auth-sso-auth-providers[SSO integration] for further examples.
There are then two ways to create the user in the database (which is required to give the users roles from native authorization):
377
377
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
+
====
381
386
382
387
.. Change the configuration to allow `native` authentication (for use only by the `admin` user):
.. 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.
391
396
392
397
[source, properties]
393
398
----
@@ -411,9 +416,9 @@ SET AUTH 'oidc-google' {SET ID 'jakesUniqueGoogleUserId'} // `jakesUniqueGoogleU
411
416
GRANT ROLE reader TO jake
412
417
----
413
418
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.
415
420
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:
0 commit comments