Skip to content

Commit 7fae8f6

Browse files
committed
Add warning for using api keys in user facing clients
1 parent 5e5be2e commit 7fae8f6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
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.
55

6-
There are advantages and disadvantages of both types. API keys are quick to start working with but do not allow for access controls. JWKS (JSON Web Key Sets) authentication providers require an external identity provider but do allow for fine grained rules around authentication/authorization.
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.
77

88
[NOTE]
99
====
@@ -12,7 +12,7 @@ There are advantages and disadvantages of both types. API keys are quick to star
1212

1313
== Create a JWKS Authentication Provider
1414

15-
Before using JWKS, 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.
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.
1616

1717
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.
1818

@@ -34,6 +34,11 @@ On success, the command will respond with details about the newly created JWKS p
3434

3535
== Create an API Key Authentication Provider
3636

37+
[WARNING]
38+
====
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.
40+
====
41+
3742
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.
3843

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

0 commit comments

Comments
 (0)