Closed Sakurann closed 11 months ago
JWT RFC requires defining a signature profile by the "application".
If we follow the specs, nothing prevents using JWT claims in the payload, since this is a property of JWT - JWT is a combination of enveloping and detached signature.
JOSE actually consists of
See: https://github.com/w3c/vc-jose-cose/issues/132#issue-1817291093 - part where issuer != signer.
When JWT is used, the application should define a JWT signature profile and with it whether or not the JWT claims are used. We're only using JWS (compact/JSON) (without JWT claims).
Currently I'm analysing a flow and it may happen that in a VP nonce may be used (in that particular case).
Theoretically JWT claims could appear in the VC (it is a nature of JWT design). I personally believe it is not a good practice (except if very well defined).
@Sakurann , if the WG agrees to add
"registered JWT claims can be used in the JOSE header but should not be used in the body".
I recommend to drop "JWT" and start using JWS (compact/JSON serialised). JWT is JWS compact + payload claims. So JWT without payload claims is JWS compact.
Pitching JWT seems the best thing to do, because JWT will always mess with the payload, and that's not desirable in any way.
@alenhorvat there claims are registered via a JWT RFC, so I think they need to be called "registered JWT claims"...
@Sakurann thank you for the correction. I'll do my best to be more accurate in the future :)
I gave it some thought and since JWTs will be used in the future, it would be beneficial to summarise how registered JWT claims can be used with VCDM (for protection purposes). I understand that this might be controversial to some, but I believe it is better if VCDM protected by JWT is defined, than left open (which will lead to some strange use of the VCDM and JWT)
WDYT?
I agree with you @alenhorvat that it needs to be defined which JWT claims must be in the header and which in the body, but I don't think @OR13 agrees.
It's not about what I believe.
People put iss
in the payload.
The original purpose of putting claims in the header was for encrypted payloads.
W3C is really not the right place to change this kind of behavior, so this is what I am recommending:
@OR13 that's a great observation (people putting claims in the payload, not in the header). An interesting issue occurred in the mDL profile, where suddenly the encrypted response cannot be matched against the request (nonce and state are encrypted)
WG should decide whether it wants or not define a profile for "JWT", similar to JOSE. (I still own the JAdES profile; Will do my best to write the proposal next week)
I agree with 1 and 2.
We have observed that 3a cannot be used with remote e-sealing services, since one only sends the digest to be signed to the remote e-sealing service(never the payload) and the service should never modify the payload. If signer or signature-creation related information is inside of the payload, there's an issue. (signer may want to control the iat, iss, for example)
Existing JOSE and JAdES protection mechanisms should cover most new implementations.
At https://w3c.github.io/vc-jose-cose/#registered-claim-names, I would suggest changing "When found in the Protected Header, or the Protected Claimset" to "When found in the JWT Claims Set or the Protected Header".
It would be better to list the JWT Claims Set first, since that's the normal place for claims. Plus we should be using the correct name "JWT Claims Set".
The issue was discussed in a meeting on 2023-09-14
@selfissued we think maybe we can resolve by removing confusing text.
I think we should state only what header parameters are required... and remove anything suggesting optionality or duplication.
AFAIK, kid
and alg
are required. typ
and cty
are optional
@selfissued We discussed that you would address this in your "clean up" PR
on our call, @decentralgabe discussed wanting to take a stab at this
Current
Registered Claim Names
section implies that registered JWT claims be used only in the JOSE header, but there is no normative statements around it. I think the assumption is that the body of JWT is as defined in vc-data-model, which means registered JWT claims are not used. Otherwise, implementers might putiss
andissuer
in the body and we are back toin addition to
logic we had in VCDM v1.1. so... probably wise to add a paragraph stating that "registered JWT claims can be used in the JOSE header but should not be used in the body".