Skip to content

Commit c874dd0

Browse files
authored
Reorganizing the migration guide and adding some missing content (#23)
* Reorganizing the migration guide and adding some missing content * Fix heading levels
1 parent 9850281 commit c874dd0

File tree

3 files changed

+387
-314
lines changed

3 files changed

+387
-314
lines changed

modules/ROOT/pages/migration/v4-migration/authorization.adoc

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
= Authentication and Authorization
22

3-
The largest breaking change in version 4.0.0 is the removal of the `@auth` directive, which requires a migration to the new `@authentication` and `@authorization` directives.
3+
The largest breaking change in version 4.0.0 is the removal of the `@auth` directive, which requires a migration to the new `@authentication`, `@authorization` and `@subscriptionsAuthorization` directives.
44

55
== Instantiation
66

@@ -12,7 +12,9 @@ You should uninstall the previous plugin:
1212
npm uninstall @neo4j/graphql-plugin-auth
1313
----
1414

15-
Then, given an example of instantiation using a basic secret with the plugin:
15+
=== Symmetric secret
16+
17+
Given an example of instantiation using a symmetric secret with the plugin:
1618

1719
[source, typescript, indent=0]
1820
----
@@ -40,6 +42,38 @@ new Neo4jGraphQL({
4042
})
4143
----
4244

45+
=== JWKS endpoint
46+
47+
When using a JWKS endpoint, an example of how this might be configured currently is:
48+
49+
[source, typescript, indent=0]
50+
----
51+
new Neo4jGraphQL({
52+
typeDefs,
53+
plugins: {
54+
auth: new Neo4jGraphQLAuthJWKSPlugin({
55+
jwksEndpoint: "https://YOUR_DOMAIN/well-known/jwks.json",
56+
}),
57+
}
58+
})
59+
----
60+
61+
In version 4.0.0, delete the import of `Neo4jGraphQLAuthJWKSPlugin`, and change the instantiation to:
62+
63+
[source, typescript, indent=0]
64+
----
65+
new Neo4jGraphQL({
66+
typeDefs,
67+
features: {
68+
authorization: {
69+
key: {
70+
url: "https://YOUR_DOMAIN/well-known/jwks.json",
71+
},
72+
}
73+
}
74+
})
75+
----
76+
4377
== Server
4478

4579
Previously, you could pass in the entire request object and the library would find the `Authorization` header:

0 commit comments

Comments
 (0)