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
This guide explains how your Quarkus application can utilize MicroProfile Json Web Token (link:https://jwt.io/[JWT])
@@ -298,7 +298,7 @@ nQIDAQAB
298
298
299
299
=== Generating a JWT
300
300
301
-
Often one obtains a JWT from an identity manager like https://www.keycloak.org/[Keycloak], but for this quickstart we will generate our own using the JWT generation API provided by `smallrye-jwt` (see <<generate-jwt-tokens, Generate JWT tokens with Smallrye JWT>> for more infomation) and the TokenUtils class shown in the following listing. Take this source and place it into `security-jwt-quickstart/src/test/java/org/acme/security/jwt/TokenUtils.java`.
301
+
Often one obtains a JWT from an identity manager like https://www.keycloak.org/[Keycloak], but for this quickstart we will generate our own using the JWT generation API provided by `smallrye-jwt` (see <<generate-jwt-tokens, Generate JWT tokens with SmallRye JWT>> for more infomation) and the TokenUtils class shown in the following listing. Take this source and place it into `security-jwt-quickstart/src/test/java/org/acme/security/jwt/TokenUtils.java`.
302
302
303
303
304
304
.JWT utility class
@@ -937,9 +937,9 @@ precedence:
937
937
- JSON Web Key (JWK) Base64 URL encoded
938
938
- JSON Web Key Set (JWKS) Base64 URL encoded
939
939
940
-
=== Additional Smallrye JWT configuration
940
+
=== Additional SmallRye JWT configuration
941
941
942
-
Smallrye JWT provides more properties which can be used to customize the token processing:
942
+
SmallRye JWT provides more properties which can be used to customize the token processing:
943
943
944
944
[cols="<m,<m,<2",options="header"]
945
945
|===
@@ -951,7 +951,7 @@ Smallrye JWT provides more properties which can be used to customize the token p
951
951
|smallrye.jwt.token.schemes|`Bearer`|Comma-separated list containing an alternative single or multiple schemes, for example, `DPoP`.
952
952
|smallrye.jwt.token.kid|none|Key identifier. If it is set then the verification JWK key as well every JWT token must have a matching `kid` header.
953
953
|smallrye.jwt.time-to-live|none|The maximum number of seconds that a JWT may be issued for use. Effectively, the difference between the expiration date of the JWT and the issued at date must not exceed this value.
954
-
|smallrye.jwt.require.named-principal|`false`|If an application relies on `java.security.Principal` returning a name then a token must have a `upn` or `preferred_username` or `sub` claim set. Setting this property will result in Smallrye JWT throwing an exception if none of these claims is available for the application code to reliably deal with a non-null `Principal` name.
954
+
|smallrye.jwt.require.named-principal|`false`|If an application relies on `java.security.Principal` returning a name then a token must have a `upn` or `preferred_username` or `sub` claim set. Setting this property will result in SmallRye JWT throwing an exception if none of these claims is available for the application code to reliably deal with a non-null `Principal` name.
955
955
|smallrye.jwt.path.sub|none|Path to the claim containing the subject name. It starts from the top level JSON object and can contain multiple segments where each segment represents a JSON object name only, example: `realms/subject`. This property can be used if a token has no 'sub' claim but has the subject set in a different claim. Use double quotes with the namespace qualified claims.
956
956
|smallrye.jwt.claims.sub|none| This property can be used to set a default sub claim value when the current token has no standard or custom `sub` claim available. Effectively this property can be used to customize `java.security.Principal` name if no `upn` or `preferred_username` or `sub` claim is set.
957
957
|smallrye.jwt.path.groups|none|Path to the claim containing the groups. It starts from the top level JSON object and can contain multiple segments where each segment represents a JSON object name only, example: `realm/groups`. This property can be used if a token has no 'groups' claim but has the groups set in a different claim. Use double quotes with the namespace qualified claims.
@@ -963,7 +963,7 @@ Smallrye JWT provides more properties which can be used to customize the token p
963
963
|===
964
964
965
965
[[generate-jwt-tokens]]
966
-
== Generate JWT tokens with Smallrye JWT
966
+
== Generate JWT tokens with SmallRye JWT
967
967
968
968
JWT claims can be signed or encrypted or signed first and the nested JWT token encrypted.
969
969
Signing the claims is used most often to secure the claims. What is known today as a JWT token is typically produced by signing the claims in a JSON format using the steps described in the link:https://tools.ietf.org/html/rfc7515[JSON Web Signature] specification.
Copy file name to clipboardExpand all lines: extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/configproperties/ConfigPropertiesUtil.java
Copy file name to clipboardExpand all lines: extensions/smallrye-fault-tolerance/deployment/src/main/java/io/quarkus/smallrye/faulttolerance/deployment/SmallRyeFaultToleranceProcessor.java
Copy file name to clipboardExpand all lines: extensions/smallrye-fault-tolerance/runtime/src/main/java/io/quarkus/smallrye/faulttolerance/runtime/QuarkusFaultToleranceOperationProvider.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ public FaultToleranceOperation apply(CacheKey key) {
30
30
};
31
31
32
32
/**
33
-
* Called by SmallryeFaultToleranceRecorder to init the operation cache.
33
+
* Called by SmallRyeFaultToleranceRecorder to init the operation cache.
Copy file name to clipboardExpand all lines: extensions/smallrye-fault-tolerance/runtime/src/main/java/io/quarkus/smallrye/faulttolerance/runtime/SmallRyeFaultToleranceRecorder.java
Copy file name to clipboardExpand all lines: extensions/smallrye-jwt/deployment/src/main/java/io/quarkus/smallrye/jwt/deployment/SmallRyeJWTConfig.java
Copy file name to clipboardExpand all lines: extensions/smallrye-jwt/deployment/src/main/java/io/quarkus/smallrye/jwt/deployment/SmallRyeJwtProcessor.java
0 commit comments