Open samuelgoto opened 3 days ago
There is a note at https://www.ietf.org/archive/id/draft-ietf-oauth-selective-disclosure-jwt-13.html#name-discussion-venues that points to this repo at https://github.com/oauth-wg/oauth-selective-disclosure-jwt which would probably be a more appropriate place due to it being the repo for SD-JWT.
That said, there are a ton of other arrays in that draft that also have space between elements. One of the main reasons for the base64url encoded stuff as the input to integrity calculations is the tolerance for (or not having to deal with) different JSON representations that are semantically equivalent.
Just a small note, as I was reading along the SD-JWT+KB and ran into a problem implementing this section:
https://www.ietf.org/archive/id/draft-ietf-oauth-selective-disclosure-jwt-13.html#section-4.2.1-2.2
The problem is that in this section, my JSON serializer (and I think, most people's web-based JSON.stringy()-based serializer) removes white space between array elements.
So, I was getting
["_26bc4LT-ac6q2KI6cBW5es","family_name","Möbius"]
rather than["_26bc4LT-ac6q2KI6cBW5es", "family_name", "Möbius"]
, which base64url encodes toWyJfMjZiYzRMVC1hYzZxMktJNmNCVzVlcyIsImZhbWlseV9uYW1lIiwiTcO2Yml1cyJd
rather thanWyJfMjZiYzRMVC1hYzZxMktJNmNCVzVlcyIsICJmYW1pbHlfbmFtZSIsICJNw7ZiaXVzIl0
as is in the example.Since it wasn't matching what was in the spec, I had to debug for a while before I convinced myself that my implementation was valid, so figured other people would too.