Giter Site home page Giter Site logo

Comments (8)

marek-kuzora avatar marek-kuzora commented on August 17, 2024 1

I would also love to get header parameters support. Right now I have no way of extracting kid from google provided jwt and therefore I don't know which key to use to verify the signature (google jwt structure: https://firebase.google.com/docs/auth/admin/verify-id-tokens).

What's the ETA on fixing this bug?

from libjwt.

benmcollins avatar benmcollins commented on August 17, 2024

Can you elaborate on what "kid header parameter" is?

Also, check.h is in GNU Check library. You need that in order to compile the test suite (make check)

from libjwt.

benmcollins avatar benmcollins commented on August 17, 2024

I just looked into this. What I really need to do is allow arbitrary header values. Something that LibJWT doesn't do, at the moment.

from libjwt.

noisy62 avatar noisy62 commented on August 17, 2024

kid is an optional header in JWS standard RFC7515:
4.1.4. "kid" (Key ID) Header Parameter

The "kid" (key ID) Header Parameter is a hint indicating which key
was used to secure the JWS. This parameter allows originators to
explicitly signal a change of key to recipients. The structure of
the "kid" value is unspecified. Its value MUST be a case-sensitive
string. Use of this Header Parameter is OPTIONAL.

When used with a JWK, the "kid" value is used to match a JWK "kid"
parameter value.

a typical Apple Music Developer Token payload is like:
{
"alg": "ES256",
"kid": "ABC123DEFG"
}
{
"iss": "DEF123GHIJ",
"iat": 1437179036,
“exp”: 1493298100
}

For now I will just modify the source by adding a new function with additional parameter based on jwt_encode(). But for the future, it is nice to have the feature for libjwt to be able to add optional headers.

from libjwt.

noisy62 avatar noisy62 commented on August 17, 2024

Hi Ben!
I added a command line utility program amdevtok on the base of libjwt. Modified jwt.h/jwt.c to add 2 customized functions. The work is in a clone: https://github.com/noisy62/amdevtok/blob/master/amdevtok.diff.

IMHO, it will be useful to expand the jwt_t structure to accommodate optional header parameters.

But for this sole purpose of Apple Music Developer Token creation, a little hack is enough. Thanks for your work!!!

from libjwt.

hcngac avatar hcngac commented on August 17, 2024

#71 Please review and see if this is useful

from libjwt.

benmcollins avatar benmcollins commented on August 17, 2024

This is resolved with some commits that were just merged.

from libjwt.

marek-kuzora avatar marek-kuzora commented on August 17, 2024

Great, thanks!

from libjwt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.