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/database-administration/aliases/manage-aliases-standard-databases.adoc
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -421,6 +421,7 @@ FOR DATABASE
421
421
----
422
422
423
423
The `OIDC CREDENTIAL FORWARDING` clause is used to configure a remote database alias to use the logged-in user's OIDC credentials to authenticate to the remote DBMS.
424
+
In order to use this method to authenticate, the local DBMS and remote DBMS needs to have SSO authentication and authorization through identity providers implementing the OIDC standard configured, see the xref:authentication-authorization/sso-integration.adoc[SSO integration] on how to configure OIDC identity providers.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/database-administration/aliases/remote-database-alias-configuration.adoc
+91-17Lines changed: 91 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,8 +20,13 @@ A remote alias defines:
20
20
* Where the remote database is located.
21
21
* How to connect to the remote database using driver settings.
22
22
23
-
When creating the remote database alias, it can either be configured to store the credentials of a single user on the remote **DBMS B**, or to pass on the bearer authentication token from the user who issues the query.
23
+
When creating the remote database alias, it can be configured to authenticate with either:
24
24
25
+
* `STORED NATIVE CREDENTIALS`, i.e. the credentials of a single user on the remote **DBMS B**.
26
+
* `OIDC CREDENTIAL FORWARDING`, i.e. passing the bearer authentication token from the user who issues the query. In order to use this method to authenticate, the local *DBMS A* and remote *DBMS B* needs to have SSO authentication and authorization through identity providers implementing the OIDC standard configured, see the xref:authentication-authorization/sso-integration.adoc[SSO integration] on how to configure OIDC identity providers.
27
+
28
+
29
+
[[setup-example-stored-native-credentials]]
25
30
== Setup example with stored native credentials
26
31
27
32
In this example, _Alice_ is an administrator and _Carol_ is a user who needs access to a database managed by _Bob_:
@@ -147,6 +152,55 @@ chmod 640 conf/neo4j.conf
147
152
bin/neo4j start --expand-commands
148
153
----
149
154
155
+
=== Manage remote database aliases
156
+
157
+
You can use the xref:database-administration/aliases/manage-aliases-standard-databases.adoc[alias commands] to manage remote database aliases.
158
+
In this case, it is strongly recommended to connect to a remote database alias with a secured connection.
159
+
160
+
Please note that only client-side SSL is supported.
161
+
By default, remote aliases require a secured URI scheme such as `neo4j+s`.
162
+
This can be disabled by setting the driver setting `ssl_enforced` to `false`.
163
+
164
+
For example, the following command can be used to create a remote database alias with stored native credentials:
165
+
166
+
[source, Cypher]
167
+
----
168
+
CREATE ALIAS `remote-neo4j` FOR DATABASE `neo4j` AT "neo4j+s://location:7687" USER alice PASSWORD 'secretpassword'
169
+
----
170
+
171
+
In order to do so, either xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-database-management[database management]
172
+
or xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-alias-management[alias management] privileges are required.
173
+
The permission to create an alias can be granted like this:
174
+
175
+
[source, Cypher]
176
+
----
177
+
GRANT CREATE ALIAS ON DBMS TO administrator
178
+
----
179
+
180
+
Here is how to grant the xref:authentication-authorization/database-administration.adoc#access-control-database-administration-access[`ACCESS` privileges] to use the remote database alias:
181
+
182
+
[source, Cypher]
183
+
----
184
+
GRANT ACCESS ON DATABASE `remote-neo4j` TO role
185
+
----
186
+
187
+
[NOTE]
188
+
====
189
+
If a transaction modifies an alias (e.g. changing the database targeted on **DBMS B**), other transactions concurrently executing against that alias may be aborted and rolled back for safety.
190
+
This prevents issues such as a transaction executing against multiple target databases for the same alias.
191
+
====
192
+
193
+
=== Change the encryption key
194
+
195
+
If the encryption key in the keystore is changed, the encrypted credentials for existing remote database aliases will need to be updated as they will no longer be readable.
196
+
197
+
[NOTE]
198
+
====
199
+
If there is a failure when reading the keystore file, investigate the `debug.log` to find out which parameter is the source of the problem.
200
+
In case it is not possible to connect to the remote alias after its creation, verify its settings by connecting to the remote database at https://browser.neo4j.io/ or at your local browser.
201
+
====
202
+
203
+
[[setup-example-credential-forwarding]]
150
204
== Setup example with OIDC credential forwarding
151
205
152
206
In order to use OIDC credential forwarding, both *DBMS A* and *DBMS B* need to support the same OIDC identity provider, see the xref:authentication-authorization/sso-integration.adoc[SSO integration] on how to enable OIDC.
You can use the xref:database-administration/aliases/manage-aliases-standard-databases.adoc[alias commands] to manage remote database aliases.
208
277
In this case, it is strongly recommended to connect to a remote database alias with a secured connection.
@@ -211,15 +280,15 @@ Please note that only client-side SSL is supported.
211
280
By default, remote aliases require a secured URI scheme such as `neo4j+s`.
212
281
This can be disabled by setting the driver setting `ssl_enforced` to `false`.
213
282
214
-
For example, the following command can be used to create a remote database alias:
283
+
For example, the following command can be used to create a remote database alias with OIDC credential forwarding:
215
284
216
285
[source, Cypher]
217
286
----
218
-
CREATE ALIAS `remote-neo4j` FOR DATABASE `neo4j` AT "neo4j+s://location:7687" USER alice PASSWORD 'secretpassword'
287
+
CREATE ALIAS `remote-neo4j` FOR DATABASE `neo4j` AT "neo4j+s://location:7687" OIDC CREDENTIAL FORWARDING
219
288
----
220
289
221
-
In order to do so, either lxref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-database-management[database management]
222
-
or lxref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-alias-management[alias management] privileges are required.
290
+
In order to do so, either xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-database-management[database management]
291
+
or xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-alias-management[alias management] privileges are required.
223
292
The permission to create an alias can be granted like this:
224
293
225
294
[source, Cypher]
@@ -231,25 +300,22 @@ Here is how to grant the xref:authentication-authorization/database-administrati
231
300
232
301
[source, Cypher]
233
302
----
234
-
GRANT ACCESS ON DATABASE `remote-neo4j` TO role
303
+
GRANT ACCESS ON DATABASE `remote-neo4j` TO admin
235
304
----
236
305
237
306
[NOTE]
238
307
====
239
-
If a transaction modifies an alias (e.g. changing the database targeted on **DBMS B**), other transactions concurrently executing against that alias may be aborted and rolled back for safety.
240
-
This prevents issues such as a transaction executing against multiple target databases for the same alias.
308
+
In order for _Carol_ to get access to the remote database alias, she needs to be in an identity provider group that is mapped to a Neo4j role that is granted access to alias. In this example, if _Carol_ is in the identity provider group `engineers` which is mapped to the admin role, she will get the privileges of an admin and access to `remote-neo4j`.
309
+
For details on how to map identity provider groups to Neo4j roles, see xref:authentication-authorization/sso-integration.adoc#auth-sso-map-idp-roles[Map the identity provider groups to the Neo4j roles].
241
310
====
242
311
243
-
== Change the encryption key
244
-
245
-
If the encryption key in the keystore is changed, the encrypted credentials for existing remote database aliases will need to be updated as they will no longer be readable.
246
-
247
312
[NOTE]
248
313
====
249
-
If there is a failure when reading the keystore file, investigate the `debug.log` to find out which parameter is the source of the problem.
250
-
In case it is not possible to connect to the remote alias after its creation, verify its settings by connecting to the remote database at https://browser.neo4j.io/ or at your local browser.
314
+
If a transaction modifies an alias (e.g. changing the database targeted on **DBMS B**), other transactions concurrently executing against that alias may be aborted and rolled back for safety.
315
+
This prevents issues such as a transaction executing against multiple target databases for the same alias.
251
316
====
252
317
318
+
253
319
== Connect to remote database aliases
254
320
255
321
A user can connect to a remote database alias the same way they would do to a database.
@@ -265,7 +331,7 @@ USE `remote-neo4j` MATCH (n) RETURN *
265
331
266
332
* Connecting to a remote database alias as a home database.
267
333
This needs to be set by Administrator A.
268
-
See more about lxref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-user-management[User Management].
334
+
See more about xref:authentication-authorization/dbms-administration.adoc#access-control-dbms-administration-user-management[User Management].
269
335
270
336
[source, Cypher]
271
337
----
@@ -277,3 +343,11 @@ ALTER USER alice SET HOME DATABASE `remote-neo4j`
277
343
Remote alias transactions will not be visible in `SHOW TRANSACTIONS` on **DBMS A**.
278
344
However, they can be accessed and terminated on the remote database when connecting with the same user.
279
345
====
346
+
347
+
[NOTE]
348
+
====
349
+
Action on the remote DBMS are all attributed to the user configured for the remote database alias.
350
+
In the case of using `STORED NATIVE CREDENTIALS`, the same credentials are used to connect to the remote DBMS independent on which end-user made the query targeting the remote alias. This will result in the stored native user being logged in the audit trails on the remote DBMS for all queries using the remote database alias.
351
+
When using `OIDC CREDENTIAL FORWARDING` the actual end-user´s credentials and permissions will be used, this will result in per-user audit trails being logged on the remote DBMS.
0 commit comments