Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #137
I've spent a lot of time on this iteration round trying to address all the JWT protection scenarios without over-complicating things while also providing the optimized support for the mainstream
sign JWT
path. The following is now supported at the API level:Sign the claims without setting the headers
or
or
or
Set the headers and sign the claims
Encrypt the claims
or
Sign the claims and encrypt the inner JWT
or
The locations and types of the configured keys
Sign and encrypt methods which take no parameters (
sign()
,innerSign()
andencrypt()
) depend on the keys being loaded from the configured locations. The same rules which are used to load the MP JWT verification keys apply here: the keys can bePEM
,JWK
orJWK
in theJWK set
and they can be located on the classpath, filesystem, or HTTP(S) URLsAPI Design Considerations
jws()
orjwe()
transitions, with the extra benefit being that the users will see JWT as an instance of JWS (sign) and/or JWE (encrypt, sign-encrypt)SignatureAlgorithm
,KeyEncryptionAlgorithm
andContentEncryptionAlgorithm
values are currenty restricted but can be opened up depending on the requirements. Note these enums are not part of thebuild
subpackage because I expect we will use the same algorithm values independently, as part of the token verification process..CC @starksm64 @kenfinnigan @darranl