Replies: 3 comments 5 replies
-
Hi @mrts ! We don't have any plans to expose these lower-level implementation details at this time - they are considered internal implementation details and are not curated/planned/designed for extensibility, or more importantly, supportability. In other words, the As such, the It would be best to think of the JJWT So, that's our 'official' stance on why things are they way they are. I think there could be future work dedicated to enhancing 'supporting' API concepts for application developers that wish to create their own Algorithm implementations - for example, if you create your own But if the desire is not "I'm using JJWT, and I want to create a custom algorithm implementation", but instead "I prefer a simpler way than the JDK's cryptography APIs, and I'd like to use JJWT's cryptographic primitives out of convenience", then that would be the reason I've created the https://github.com/lhazlewood/scrapi project. It is even possible one day that the next version of JJWT's Does this help? Thoughts? |
Beta Was this translation helpful? Give feedback.
-
Hi @lhazlewood! Thank you for the clarification regarding the You are right that the desire is not "I'm using JJWT, and I want to create a custom algorithm implementation", but it's not quite "I prefer a simpler way than the JDK's cryptography APIs, and I'd like to use JJWT's cryptographic primitives out of convenience" either. We use JJWT in the web-eid-authtoken-validation-java library for validating Web eID authentication tokens during authentication with electronic ID smart cards in web applications. Web eID authentication tokens (WeIDAT) are intentionally not in JWT format [1]. Since there does not exist a standardized format of an authentication proof that fulfills the needs of the Web eID authentication protocol, we use a special purpose format for the WeIDAT. However, we still use the proven basic building blocks of JWT in WeIDAT: the JSON format, base64-encoding and JSON Web Signature Algorithms as defined in RFC 7518. The WeIDAT signature verification procedure is therefore pretty much identical to JWT, here is the current implementation using JJWT 0.12. So, our desire is to leverage JJWT's robust cryptographic components for specialized validation of Web eID authentication tokens, which require the security and reliability of JJWT, close to, but not quite within the standard JWT framework. Now, the following APIs are already part of the public JJWT SignatureAlgorithm signatureAlgorithm = (SignatureAlgorithm) Jwts.SIG.get().forKey(algorithm)
VerifySecureDigestRequest<PublicKey> verificationRequest
signatureAlgorithm.verify(verificationRequest) So, the only point of contention is the availability of the Considering the utility and fit of the Thanks in advance for considering this and hats off for your excellent work with JJWT! [1] The OpenID Connect ID Token JWT format was initially considered, but it was found that any similarities of the Web eID authentication token to the JWT format are actually undesirable, as they would imply that the claims presented in the Web eID authentication token can be trusted and processed, while actually they cannot be trusted as the token is created in the user's untrusted environment. The solutions are fundamentally different – the purpose of OpenID Connect (and JWT in general) is to exchange identity claims that are signed by a trusted party (usually an authentication server), while the purpose of the Web eID authentication token is to prove that the user is able to create signatures with the private key that corresponds to the presented certificate. The claims (person name, ID code, possibly e-mail address) can be extracted from the certificate only after it has been validated. |
Beta Was this translation helpful? Give feedback.
-
I just created #940 to track associated work based on this discussion, so I'm marking it as closed (please use the new ticket for further associated discussion and/or requests). If you'd like to re-open it however, please let me know! |
Beta Was this translation helpful? Give feedback.
-
Hi JJWT team!
As 1.0 is getting closer now, I would like to propose officially giving access to lower-level foundational cryptographic APIs like in the following example:
This would enable others to build upon the good work that has gone into the implementation of the foundational APIs.
However, there are two concerns with this:
io.jsonwebtoken.impl
namespace andjjwt-impl
JAR to accessDefaultVerifySecureDigestRequest
. The JJWT documentation clearly advises against adding thejjwt-impl.jar
to projects with compile scope.DefaultVerifySecureDigestRequest<PublicKey>
constructor and having to useByteArrayInputStream
feel somewhat cumbersome for this use-case, perhaps there is a way to streamline it - or maybe not, this is a minor issue.What are your thoughts regarding this?
Beta Was this translation helpful? Give feedback.
All reactions