Skip to content

Commit 35dfe65

Browse files
rsill-neo4jLiam-Doodson
authored andcommitted
Apply suggestions from code review
authentication providers section
1 parent e8d20d7 commit 35dfe65

File tree

1 file changed

+37
-19
lines changed

1 file changed

+37
-19
lines changed

modules/ROOT/pages/aura-graphql-data-apis/authentication-providers.adoc

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,41 @@
11
[[auth-providers]]
2-
= Authentication Providers
2+
= Authentication providers
33

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.
56

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.
710

811
[NOTE]
912
====
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.
1116
====
1217

13-
== Create a JWKS Authentication Provider
18+
== Creating a JWKS authentication provider
1419

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:
1621

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.
1830

1931
[NOTE]
2032
====
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.
2235
====
2336

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.
2539

2640
At a command prompt, type the following, swapping out the UPPERCASE values for your own:
2741

@@ -30,16 +44,19 @@ At a command prompt, type the following, swapping out the UPPERCASE values for y
3044
aura-cli data-api graphql auth-provider create --data-api-id YOUR_GRAPHQL_DATA_API_ID --instance-id YOUR_AURA_INSTANCE_ID --name AUTH_PROVIDER_FRIENDLY_NAME --type jwks --url JWKS_URL
3145
----
3246

33-
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.
3448

35-
== Create an API Key Authentication Provider
49+
== Creating an API Key Authentication Provider
3650

3751
[WARNING]
3852
====
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.
4056
====
4157

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.
4360

4461
At a command prompt, type the following, swapping out the UPPERCASE values for your own:
4562

@@ -55,7 +72,7 @@ On success, the command will respond with details about the newly created API Ke
5572
Make sure to record the API key shown in the response as it will not be displayed again.
5673
====
5774

58-
== List Authentication Providers
75+
== Listing authentication providers
5976

6077
To see the list of authentication providers for a given GraphQL API use the following, exchanging UPPERCASE values for your own.
6178

@@ -64,19 +81,20 @@ To see the list of authentication providers for a given GraphQL API use the foll
6481
aura-cli data-api graphql auth-provider list --data-api-id YOUR_GRAPHQL_DATA_API_ID --instance-id YOUR_AURA_INSTANCE_ID
6582
----
6683

67-
== Delete an Authentication Provider
84+
== Deleting an authentication provider
6885

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.
7088

71-
. Find the API authentication provider ID
89+
. Find the API authentication provider ID.
7290
+
7391
[source, bash, indent=0]
7492
----
7593
aura-cli data-api graphql auth-provider list --data-api-id YOUR_GRAPHQL_DATA_API_ID --instance-id YOUR_AURA_INSTANCE_ID --output table
7694
----
7795
+
78-
. From the table, locate ID for the authentication provider that you wish to delete
79-
. Delete the API key provider with this aura-cli statement
96+
. From the table, locate the ID for the authentication provider that you wish to delete.
97+
. Delete the API key provider with the following aura-cli statement.
8098
+
8199
[source, bash, indent=0]
82100
----

0 commit comments

Comments
 (0)