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.

Incorrect invalid algorithm error

See original GitHub issue

this works:

require('jsonwebtoken').verify('eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.TCYt5XsITJX1CxPCT8yAV-TVkIEq_PbChOMqsLfRoPsnsgw5WEuts01mq-pQy7UJiN5mgRxD-WUcX16dUEMGlv50aqzpqh4Qktb3rk-BuQy72IFLOqV0G_zS245-kronKb78cPN25DGlcTwLtjPAYuNzVBAh4vGHSrQyHUdBBPM', `-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDdlatRjRjogo3WojgGHFHYLugd
UWAY9iR3fy4arWNA1KoS8kVw33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQs
HUfQrSDv+MuSUMAe8jzKE4qW+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5D
o2kQ+X5xK9cipRgEKwIDAQAB
-----END PUBLIC KEY-----`)

(example from jwt.io)

This gives invalid algorithm instead of complaining about the key:

require('jsonwebtoken').verify('eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.TCYt5XsITJX1CxPCT8yAV-TVkIEq_PbChOMqsLfRoPsnsgw5WEuts01mq-pQy7UJiN5mgRxD-WUcX16dUEMGlv50aqzpqh4Qktb3rk-BuQy72IFLOqV0G_zS245-kronKb78cPN25DGlcTwLtjPAYuNzVBAh4vGHSrQyHUdBBPM', `a`)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
hbrlscommented, Jan 14, 2019

Did you notice that jwt.verify(token, cert, { algorithms: ['RS256']})? It’s algorithms, not algorithm.

0reactions
felixgiftinfocommented, Oct 28, 2020

Did you notice that jwt.verify(token, cert, { algorithms: ['RS256']})? It’s algorithms, not algorithm.

Thanks, this was really helpful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - UnauthorizedError: invalid algorithm express-jwt
I am displaying some data on my website which returns from node server. It's works perfectly until today. Now I am getting below...
Read more >
Invalid Algorithm Error - Auth0 Community
I am using graphql. I am taking the accessToken and sending it as header to the backend to verify the request. On the...
Read more >
VerifyJWT policy deployment error troubleshooting
For example, in the following error message, the name of Verify JWT policy is JWT-Verify-RS256 and the element name is Algorithm : Invalid...
Read more >
Failed to generate XML signature. Invalid algorithm specified
The most likely cause is that the wrong cryptographic provider is associated with the private key. The following topic describes how to confirm...
Read more >
Error Handling — Ultrasonic Sensing Design Center User ...
Full Application Error List¶ ; 27, Invalid algorithm option ; 28, Envelope Crossing Threshold outside supported range ; 29, Start PPG Count outside...
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