Due to ServiceLoader problems with:
we should migrate away from using the JDK ServiceLoader concept, and at a minimum revert to the previous logic in 0.10.x:
|
if (this.serializer == null) { |
|
//try to find one based on the runtime environment: |
|
InstanceLocator<Serializer<Map<String,?>>> locator = |
|
Classes.newInstance("io.jsonwebtoken.impl.io.RuntimeClasspathSerializerLocator"); |
|
this.serializer = locator.getInstance(); |
|
} |
Another approach is to create our own API concept similar to ServiceLoader and allow JJWT users to specify their own implementation on the JwtBuilder or JwtParserBuilder. 95% of users would likely never configure a custom one, but it does provide an option to fix things quickly if the default implementation has problems (as opposed to waiting for a new JJWT release).
Due to
ServiceLoaderproblems with:we should migrate away from using the JDK
ServiceLoaderconcept, and at a minimum revert to the previous logic in 0.10.x:jjwt/impl/src/main/java/io/jsonwebtoken/impl/DefaultJwtBuilder.java
Lines 297 to 302 in b292b89
Another approach is to create our own API concept similar to
ServiceLoaderand allow JJWT users to specify their own implementation on the JwtBuilder or JwtParserBuilder. 95% of users would likely never configure a custom one, but it does provide an option to fix things quickly if the default implementation has problems (as opposed to waiting for a new JJWT release).