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: README.md
+16
Original file line number
Diff line number
Diff line change
@@ -1269,11 +1269,27 @@ They are checked in order, and the first one found is used:
1269
1269
Android applications _unless_ you want to use POJOs as claims. The `org.json` library supports simple
1270
1270
Object-to-JSON marshaling, but it *does not* support JSON-to-Object unmarshalling.
1271
1271
1272
+
4. JSON-B: This will automatically be used if you specify `io.jsonwebtoken:jjwt-jsonb` as a project runtime dependency.
1273
+
JSON-B also supports POJOs as claims with full marshaling/unmarshaling as necessary.
1274
+
1275
+
**NOTE**: `JSON-B` is just a specification and does not bring an implementation.
1276
+
1277
+
* In Java-SE environments you will need to add three more dependencies:
1278
+
1. `jakarta.json:jakarta.json-api`
1279
+
2. `jakarta.json.bind:jakarta.json.bind-api`
1280
+
3. A JSON-B compliant implementation like [Eclipse Yasson](https://github.com/eclipse-ee4j/yasson) or [Apache Johnzon](https://johnzon.apache.org/johnzon-jsonb/index.html).
1281
+
* In Java/Jakarta EE environments, you might need to enable the following features:
1282
+
1. json-p / json-api
1283
+
2. json-b / json-bind
1284
+
1272
1285
**If you want to use POJOs as claim values, use either the `io.jsonwebtoken:jjwt-jackson` or
1273
1286
`io.jsonwebtoken:jjwt-gson` dependency** (or implement your own Serializer and Deserializer if desired). **But beware**,
1274
1287
Jackson will force a sizable (> 1 MB) dependency to an Android application thus increasing the app download size for
1275
1288
mobile users.
1276
1289
1290
+
If you want to use POJOs and a JSON-B compliant specification _**or**_ you want to use JJWT on a JakartaEE compliant application server, use
0 commit comments