Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing typ field in the header #5

Closed
KleMiX opened this issue Jan 6, 2020 · 2 comments · Fixed by #27
Closed

Missing typ field in the header #5

KleMiX opened this issue Jan 6, 2020 · 2 comments · Fixed by #27
Labels
enhancement New feature or request

Comments

@KleMiX
Copy link

KleMiX commented Jan 6, 2020

There must be a typ: "JWT" field in the header. At least MapKit is giving a warning about it missing.
And there is no way to modify header, since it is created in JWTSerializer which is internal.

@tanner0101 tanner0101 added the enhancement New feature or request label Jan 19, 2020
@tanner0101
Copy link
Member

tanner0101 commented Jan 19, 2020

From what I can tell as well in https://tools.ietf.org/html/rfc7519#section-5.1 it seems like this should just be set to "JWT".

If present, it is RECOMMENDED that
its value be "JWT" to indicate that this object is a JWT.

If that seems correct for all cases, we could just add it here: https://github.com/vapor/jwt-kit/blob/master/Sources/JWTKit/JWTSerializer.swift#L17

If there's some reason why someone should be able to opt out of that or change it, we could have it supplied as a parameter to JWTSerializer.sign.

lukaskasa added a commit to lukaskasa/jwt-kit that referenced this issue Jun 6, 2020
Add `typ` header as parameter making "JWT" the default.
Maxim-Inv added a commit to Maxim-Inv/jwt-kit that referenced this issue Jun 25, 2020
Missing typ field in the header vapor#5
@Maxim-Inv
Copy link
Contributor

@tanner0101 could you review my PR #27? I'll be very appreciated.

tanner0101 pushed a commit that referenced this issue Jun 25, 2020
* Missing typ field in the header #5

Add `typ` header as parameter making "JWT" the default.

* Add missing typ, cty fields in the header

* Update JWTSigner.swift

* minor fix

Co-authored-by: Lukas Kasakaitis <[email protected]>
Co-authored-by: Maxim Anisimov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants