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: vertx-auth-jwt/src/main/asciidoc/index.adoc
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,15 +56,15 @@ A typical flow of JWT usage is that in your application you have one end point t
56
56
{@link examples.AuthJWTExamples#example7}
57
57
----
58
58
59
-
===Loading Keys
59
+
== Loading Keys
60
60
61
61
Loading keys can be performed in 3 different ways:
62
62
63
63
* Using secrets (symmetric keys)
64
64
* Using OpenSSL `pem` formatted files (pub/sec keys)
65
65
* Using Java Keystore files (both symmetric and pub/sec keys)
66
66
67
-
==== Using Symmetric Keys
67
+
=== Using Symmetric Keys
68
68
69
69
The default signature method for JWT's is known as `HS256`. `HS` stands in this case for `HMAC Signature using SHA256`.
70
70
@@ -78,7 +78,7 @@ All you need is a secret that is shared between you and the 3rd party, for examp
78
78
79
79
In this case the secret is configured as a public key, as it is a token that is known to both parties and you configure your PubSec key as being symmetric.
80
80
81
-
==== Using RSA keys
81
+
=== Using RSA keys
82
82
83
83
This section is by no means a manual on OpenSSL and a read on OpenSSL command line usage is advised.
84
84
We will cover how to generate the most common keys and how to use them with JWT auth.
@@ -156,7 +156,7 @@ Now you can use this to issue or validate tokens:
156
156
{@link examples.AuthJWTExamples#example15}
157
157
----
158
158
159
-
==== Using EC keys
159
+
=== Using EC keys
160
160
161
161
Elliptic Curve keys are also supported, however the default JDK has some limitations on the features that can be used.
162
162
@@ -215,7 +215,7 @@ So you can do all operations with it:
215
215
{@link examples.AuthJWTExamples#example18}
216
216
----
217
217
218
-
==== The JWT keystore file
218
+
=== The JWT keystore file
219
219
220
220
If you prefer to use Java Keystores, then you can do it either.
221
221
@@ -246,7 +246,7 @@ The validity of the certificate is tested on load and keys will not be loaded if
246
246
All keys algorithms will be checked if can be matched to the given alias.
247
247
For example an `RS256` key will not be loaded if issued with a `EC` algorithm, or if issued with `RSA` but signature `SHA1WithRSA` instead of `SHA256WithRSA`.
248
248
249
-
===== Generate a new Keystore file
249
+
==== Generate a new Keystore file
250
250
251
251
The only required tool to generate a keystore file is `keytool`, you can now specify which algorithms you need by running:
For more information on keystores and how to use the `PKCS12` format (Default from Java >=9) please see the documentation of the common module.
266
266
267
-
=== Read only tokens
267
+
== Read only tokens
268
268
269
269
If you need to consume JWT tokens issues by third parties you probably won't have the private key with you, in that case all you need to have is a public key im PEM format.
270
270
@@ -338,7 +338,7 @@ The typical usage is to extract the permissions form the user object using the p
338
338
{@link examples.AuthJWTExamples#example13}
339
339
----
340
340
341
-
By default the provider will lookup under the key `permissions` but like the other providers one can extend the concept to authorities to roles by using the `:` as a splitter, so `role:authority` can be used to lookup the token.
341
+
By default, the provider will lookup under the key `permissions` but like the other providers one can extend the concept to authorities to roles by using the `:` as a splitter, so `role:authority` can be used to lookup the token.
342
342
343
343
Since JWT are quite free form and there is no standard on where to lookup for the claims the location can be configured to use something else than `permissions`, for example one can even lookup under a path like this:
344
344
@@ -383,5 +383,5 @@ This means that there is no `iat` field in the token.
383
383
Token expiration is controlled by the property `expiresInSeconds`, by default there is no expiration.
384
384
Other control fields `audience`, `issuer` and `subject` are then picked from the config is available and added to the token metadata.
385
385
386
-
Finally the token is signed and encoded in the correct format.
386
+
Finally, the token is signed and encoded in the correct format.
0 commit comments