-
Notifications
You must be signed in to change notification settings - Fork 46
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
Can't decode JWKSet if thumbprint is not 20 bytes (incorrect number of bytes) #54
Comments
This is a bug in auth0. Per https://tools.ietf.org/html/rfc7517#section-4.8:
Therefore the unencoded datum must be 20-bytes in size. |
Thanks for your report, but you should raise the issue with auth0. Good luck! |
Thanks! |
@Leonti Did you ever end up getting anywhere with auth0? I just ran into the same issue. What did you end up doing? |
@wraithm Unfortunately there is no progress from their side: This what I ended up doing unfortunately:
It basically removes thumbprint field so it's not decoded anymore |
Fair enough. Be aware that if the Another option is to actually decode the hex-encoded thumbprint and re-encode it properly. But again that will only work when it is in the unprotected header. |
I wrote the x5t re-encoding code. @frasertweedale, is this what you were roughly thinking?:
|
Yes, pretty much along those lines.
|
Is it worth linking that snippet along side the auth0 being broken comment? |
IIUC this has been fixed upstream with signing key rotation : https://community.auth0.com/t/jwk-certificate-thumbprint-is-invalid/16070/22 |
Wow! Only took 2.5 years... Thanks for the update @ocramz. |
Hi!
While trying to decode JWKSet from Auth0 I stumbled on an issue when decoding fails because
x5t
is more than 20 bytes (I'm gettingLeft "Error in $.keys[0].x5t: incorrect number of bytes"
).Here is the value:
The decoded value for this is:
It has 40 characters in hex, so I think it will be 20 bytes when in binary.
This is the JWK set coming from https://auth0.com
The full set if needed:
Cheers,
Leonti
The text was updated successfully, but these errors were encountered: