Comments (1)
Hi @giuseppe-milazzo, that method is deprecated because ultimately each MAC or Signature Algorithm is responsible for determining what is valid or not based on its specific implementation requirements.
Starting in JJWT 0.12.0, these algorithms are pluggable and/or customizable, so it's not possible for all algorithm requirements - especially for custom algorithms - to be embedded in a single static method or Enum.
Another way of saying this is that any time an algorithm was added or removed, that static method would need to be updated, which is a yellow flag/warning that the previous code was too tightly coupled.
So, now that the algorithm implementation is itself responsible to validate keys used with it, it's no longer necessary to 'force' this to be publicly exposed. That is, nothing in JJWTs higher APIs require this method, so it would impose unnecessary implementation (and support) requirements on higher-level classes, e.g. in the Jwts.SIG
class.
Additionally, even if we did add such a method somewhere, it wouldn't work for any custom or restricted algorithms. That is, either of the following cases are possible:
-
A custom (non standard)
SignatureAlgorithm
orMacAlgorithm
implementation is added to aJwtBuilder
andJwtParser
's total set of supported algorithms. -
One or more RFC-standard
SignatureAlgorithm
orMacAlgorithm
instances are removed from aJwtBuilder
orJwtParser
's total set of supported algorithms, because the application wants to limit what algorithms are available to enforce higher strength security requirements.
In either of these two scenarios, the previous static (Enum) method couldn't 'know' what algorithms are in use or allowed by the application to perform validation.
Anyway, those are the reasons for the changes. Could you please let us know why this may not be sufficient for your needs?
What is the desired/expected behavior and/or use case for your application?
Thanks!
from jjwt.
Related Issues (20)
- package jjwt is not resolved HOT 4
- Locator for Key has no access to JWT claims (issuer) HOT 1
- Error building JWT with non-string audience claim type HOT 4
- A single audience value gets converted into a set with one entry HOT 1
- Disable Jackson ObjectMapper FAIL_ON_UNKNOWN_PROPERTIES Deserialization Feature HOT 1
- Unable to extract claims when cty specified in JWS header (>0.12.0) HOT 19
- Question: How far is version 1.0 (due to breaking changes in 0.12)?
- NIST Elliptic Curve JWK field element octet string padding HOT 1
- Allow parsing signed JWTs without the key HOT 1
- Impossible to build a JWK with `alg: HS512` and a `k` that is larger than 64 bytes HOT 2
- Make JacksonDeserializer constructor public
- Unable to access jcaName from Jwts.SIG HOT 2
- Jwts.builder - audience cannot be add without calling add() HOT 5
- Consider a convenience method to obtain a `Jwk` from a `JwkSet` by Key ID HOT 4
- Deprecation of support for unsecured JWT token parsing with algo != 'none' HOT 3
- NoSuchMethodError when using libraries built against older jjwt version HOT 2
- Unable to verify Elliptic Curve signature using configured ECPublicKey. Invalid encoding for signature HOT 2
- CVE reported against 0.11.5 HOT 5
- CVE-2024-31033 (v0.12.5) HOT 2
- java.lang.IllegalArgumentException: Invalid Map 'iv' (Initialization Vector) value: 1230868678. Values must be either String or [B instances. Value type found: java.math.BigInteger. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jjwt.