Git Product home page Git Product logo

Comments (9)

lestrrat avatar lestrrat commented on June 12, 2024 2

This seems like a similar problem. Read the last response: https://community.auth0.com/t/auth0-access-token-is-missing-the-jws-payload/71674/5

from jwx.

lestrrat avatar lestrrat commented on June 12, 2024

You are using v1?

from jwx.

divmgl avatar divmgl commented on June 12, 2024

So I noticed I was using v1 and switched over to v2. Thankfully, I'm not getting the same error. However I'm now getting a new error:

6:39AM ERR error="failed to find a valid token in any location of the request (tried: [header keys: \"Authorization\"]). Additionally, errors were encountered during attempts to parse headers: ([header key: \"Authorization\", error: \"unsupported format (layer: #1)\"])"

from jwx.

lestrrat avatar lestrrat commented on June 12, 2024

Right, I think you are using v1.

In v1, we tried to work with messages that looked like JWE(JWS(payload)) or JWS(JWE(payload)) gracefully. In hindsight this was silly, so it has been removed as of v2.

In v1, the heuristic for determining the message type is done in jwx.GuessFormat. There are a bunch of reasons why jwx.GuessFormat would think that the payload is JWE, but here are some of those:

  1. The payload contains 4 "."s
  2. The payload contains the field "ciphertext" after base64 decoding is done.

It is extremely rare that you would find the field "ciphertext" in your payload, so I would assume that you have a payload that does not look like JWS.

Without seeing the actual payload, that's all I can say, really.

from jwx.

lestrrat avatar lestrrat commented on June 12, 2024

So the error message says that it tried looking for the JWT payload inside Authorization header, and couldn't parse it. Did you check if you have a proper JWT payload in the authorization header?

from jwx.

divmgl avatar divmgl commented on June 12, 2024

So this is the header...

authorization: Bearer eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiaXNzIjoiaHR0cHM6Ly9kZXYtbnloNWk0MDcudXMuYXV0aDAuY29tLyJ9..vv7RwXbIMuqoE9Bs.BtdlzXAp3W_lFre0wbmeOahQLyyq7BFLdyagAj1udNPk6RqHnb9tpXC34XApbptEtee-mHJgG-djSJBrr3Ky1Ngq43YxIhJjZ87E1BV9h-8-qpR5j49Y4hLDRGSelVtegjye9Zb2qQM73DZaeL9T9ChnEgMoziV07MqM_dqF4l51d73_UPnAIYjNthVhVrpYzsMahhJDJEoevBT63AH0JH3GHQ6GcwNhqVbDslNfwz63DhV_vEK35ot6tXCRHPc6RM62FfocsjoyogDdWgdTD8uM1w9Ok3WI83zd3CCBws4naFuVJs7WIX6Ot920ydm6hISNvHZdSpUoYN71Eky0rFUEkx79-fxKGgKZoDllV5K5KEwXPYA2h60kxfAKjbeLWKSx1nd4HIRdpcoDAWWGzy-CSg.XVcURxNxx5obO9YpDue44Q

It's the Auth0 access_token. Another library is able to parse this token using the rsa.PrivateKey generated from your library, so I'm unsure why this wouldn't be working. Let me try extracting the header and feeding in the bytes to Parse to see what happens.

from jwx.

divmgl avatar divmgl commented on June 12, 2024

Wait a sec... that's odd. That JWT token has four segments. This is the token I'm receiving from Auth0...

from jwx.

lestrrat avatar lestrrat commented on June 12, 2024

Before going any further, this is definitely wrong:

image

And I do see 4 dots, so it definitely looks like a JWE encrypted message. In which case it would be syntactically valid to have two consecutive dots there, because that just means it's an empty protected header.

I have no clue about Auth0 and its access tokens, but it just feels wrong.

from jwx.

divmgl avatar divmgl commented on June 12, 2024

Unreal... three hours wasted. Thank you for sending that over. Not providing an audience returns an encrypted payload.

THANK YOU!!!

from jwx.

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.