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/aura-graphql-data-apis/authentication-providers.adoc
+37-19Lines changed: 37 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,27 +1,41 @@
1
1
[[auth-providers]]
2
-
= Authentication Providers
2
+
= Authentication providers
3
3
4
-
GraphQL for Neo4j AuraDB allows you to use an API key, JWT token from an external identity provider or both for authentication and switch between them as needed. The authentication method is stored as an authentication provider.
4
+
GraphQL for Neo4j AuraDB allows you to use an API key, JWT token from an external identity provider or both for authentication and switch between them as needed.
5
+
The authentication method is stored as an authentication provider.
5
6
6
-
There are advantages and disadvantages of both types. API keys are quick to start working with but do not allow for access controls and should not be used within a user facing-client application. JWKS (JSON Web Key Sets) authentication providers require an external identity provider but do allow for fine grained rules around authentication/authorization.
7
+
There are advantages and disadvantages to both types.
8
+
API keys are quickly set up but do not allow for access control and should not be used within a user-facing client application.
9
+
JWKS (JSON Web Key Sets) authentication providers require an external identity provider but do allow for fine-grained rules around authentication/authorization.
7
10
8
11
[NOTE]
9
12
====
10
-
`--data-api-id` is used with the `aura-cli` when working with authentication providers rather than `--graphql-api-id` as you might have expected. Conceptually a GraphQL API is a type of Data API and there may be other types in the future. Using `--data-api-id` allows for flexibility for potential future development work in this area.
13
+
`--data-api-id` is used with the `aura-cli` when working with authentication providers rather than `--graphql-api-id` as you might have expected.
14
+
Conceptually a GraphQL API is a type of data API and there may be other types in the future.
15
+
Using `--data-api-id` allows for flexibility for potential future development work in this area.
11
16
====
12
17
13
-
== Create a JWKS Authentication Provider
18
+
== Creating a JWKS authentication provider
14
19
15
-
Before using JWKS authentication providers, it is necessary to set up and configure an identity provider that manages users and their credentials securely, issues JWTs to authenticated users, and hosts a JWKS endpoint that is can be used to validate JWTs by the GraphQL API. There are several 3rd parties who provide this type of service, e.g Ping, Okta, Auth0 and any of the main cloud service providers. Configuration of identity providers is beyond the scope of this guide.
20
+
Before using JWKS authentication providers, you must set up and configure an identity provider that:
16
21
17
-
If you do use a JWKS authentication provider, then you can take advantage of fine-grained access controls using the ** xref:security/authentication.adoc[`@authentication`]/** xref:security/authorization.adoc[`@authorization`] directives of Graphql for Neo4j AuraDB.
22
+
* manages users and their credentials securely,
23
+
* issues JWTs to authenticated users
24
+
* hosts a JWKS endpoint that can be used to validate JWTs by the GraphQL API.
25
+
26
+
There are several 3rd parties who provide this type of service, e.g. Ping, Okta, Auth0 and any of the main cloud service providers.
27
+
Configuration of identity providers is beyond the scope of this guide.
28
+
29
+
If you do use a JWKS authentication provider, you can take advantage of fine-grained access controls using the xref:security/authentication.adoc[`@authentication`] and xref:security/authorization.adoc[`@authorization`] directives of GraphQL for Neo4j AuraDB.
18
30
19
31
[NOTE]
20
32
====
21
-
If you do make use of `@authentication`/`@authorization` rules, they will also be applied to requests made with API keys. We do not currently support adding claims to API keys so it is unlikely they will be able to meet the rules you specify.
33
+
If you make use of `@authentication` or `@authorization` rules, they are also applied to requests made with API keys.
34
+
We do not currently support adding claims to API keys so it is unlikely they are able to meet the rules you specify.
22
35
====
23
36
24
-
The aura-cli is used to create a new JWKS authentication provider. You will need the JWKS URL to do this along with the ID of the GraphQL API with it’s associated AuraDB ID.
37
+
The aura-cli is used to create a new JWKS authentication provider.
38
+
You will need the JWKS URL to do this along with the ID of the GraphQL API with its associated AuraDB ID.
25
39
26
40
At a command prompt, type the following, swapping out the UPPERCASE values for your own:
27
41
@@ -30,16 +44,19 @@ At a command prompt, type the following, swapping out the UPPERCASE values for y
On success, the command will respond with details about the newly created JWKS provider.
47
+
On success, the command responds with details about the newly created JWKS provider.
34
48
35
-
== Create an API Key Authentication Provider
49
+
== Creating an API Key Authentication Provider
36
50
37
51
[WARNING]
38
52
====
39
-
If you use an API key authentication provider in a user-facing client application, you risk leaking the API key to your users. This could potential give them full access to your GraphQL API. For these usecases, we recommend using JWKS authentication providers.
53
+
If you use an API key authentication provider in a user-facing client application, you risk leaking the API key to your users.
54
+
This can give them full access to your GraphQL API.
55
+
We recommend you to use JWKS authentication providers in user-facing client applications.
40
56
====
41
57
42
-
When a new GraphQL API is created via the aura-cli, an API Key authentication provider is the default. However, if you require a new one, this command allows you to create a new API Key.
58
+
When a new GraphQL API is created via the aura-cli, an API key authentication provider is the default.
59
+
However, if you require a new one, the following command allows you to create a new API Key.
43
60
44
61
At a command prompt, type the following, swapping out the UPPERCASE values for your own:
45
62
@@ -55,7 +72,7 @@ On success, the command will respond with details about the newly created API Ke
55
72
Make sure to record the API key shown in the response as it will not be displayed again.
56
73
====
57
74
58
-
== List Authentication Providers
75
+
== Listing authentication providers
59
76
60
77
To see the list of authentication providers for a given GraphQL API use the following, exchanging UPPERCASE values for your own.
61
78
@@ -64,19 +81,20 @@ To see the list of authentication providers for a given GraphQL API use the foll
64
81
aura-cli data-api graphql auth-provider list --data-api-id YOUR_GRAPHQL_DATA_API_ID --instance-id YOUR_AURA_INSTANCE_ID
65
82
----
66
83
67
-
== Delete an Authentication Provider
84
+
== Deleting an authentication provider
68
85
69
-
An authentication provider for a GraphQL API can be removed by deleting it. At least one enabled authentication provider is required for a GraphQL API.
86
+
An authentication provider for a GraphQL API can be removed by deleting it.
87
+
At least one enabled authentication provider is required for a GraphQL API.
0 commit comments