question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possibility of making the jwt signature verification configurable?

See original GitHub issue

By far the largest part of this library right now is `jsrsassign’ but I don’t think it really needs to be. The problem with jsrsassign is that it doesn’t lend itself to treeshaking.

For example, angular oidc client is utilising:

https://www.npmjs.com/package/jsrsasign-reduced

Which contains only the methods needed to actually verify the token. It’s still a large 140kb bundle but it’s way better than the 200-300kb we have now.

Auth0 went in a slightly different direction with https://www.npmjs.com/package/idtoken-verifier which only supports RS256 tokens however it is 14kb minified + gzipped which is a massive improvement.

I presume you can’t really dictate that in this library as it needs to be somewhat generic so my suggestion is to effectively allow the verify method to be implemented by the library consumer and perhaps include the current functionality in a separate entry point so it can be tree-shaken if a user decides not to use it.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
pamapacommented, Oct 26, 2021

I didn’t look at the PR, but I’d imagine all the response_mode stuff could also get removed if implicit is no longer supported.

i added a separate issue for this, see #162

1reaction
brockallencommented, Oct 25, 2021

I didn’t look at the PR, but I’d imagine all the response_mode stuff could also get removed if implicit is no longer supported.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Signing and Validating JSON Web Tokens (JWT) For Everyone
JWTs are signed with a key when they are generated and then validated with a key upon receipt so we can verify that...
Read more >
JWT: The Complete Guide to JSON Web Tokens
A Step-by-Step Guide for learning JSON Web Tokens, including signatures, single page web application User Authentication and Session ...
Read more >
11 JWT Token Security Best Practices | Curity
Best practices for using JTWs in applications. Learn about JWTs as access tokens, which algorithms to use, when to validate the token and...
Read more >
How To Validate a JWT Token - Medium
You can configure the secret key into all the services that receive tokens from clients so that they can verify the tokens without...
Read more >
JWT signature not verified - PortSwigger
Remediation: JWT signature not verified. Ensure that the signature of the JWT is properly verified for all supported algorithms. Vulnerability classifications.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found