-
Notifications
You must be signed in to change notification settings - Fork 24
Description
Issue Description
In skill-tree backend, we use the io.jsonwebtoken/jjwt-api (version 0.11.2) package for verifying jwt tokens which does not allow 1024-bit public keys to be used (in line with the RFC) which is why we are unable to verify the token generated by “website-backend”.
Will try downgrading the package to a lower version which supports 1024 bit keys
More details - https://docs.google.com/document/d/1LGR3aXfj91dub4ZZaFY4oAVMZLliZZ3hmDPDcfFGYjo/edit
Expected Behavior
After downgrading the packages, the Auth protected API's should start working with the token generated using the public key used in website-backend (1024 bits)
Current Behavior
Verificiation of the token fails, as 1024 bit public keys are not supported by the JWT package used in skill-tree (this is in line with the latest RFC)
Screenshots
(io.jsonwebtoken.security.WeakKeyException)

Reproducibility
- This issue is reproducible
- This issue is not reproducible
Steps to Reproduce
- Get the auth cookie by following the steps mentioned below for local / staging:
- https://github.com/Real-Dev-Squad/skill-tree-backend?tab=readme-ov-file#to-authenticate-yourself
- (If running locally, In your .env file use the same public key used in wesbite-backend(https://github.com/Real-Dev-Squad/website-backend/blob/develop/config/development.js#L34)
- Visit any auth protected api endpoint (Example /v1/skills) , you will get a 401 error with the following message:
{ "message": "The access token provided is expired, revoked, malformed, or invalid for other reasons." }
You can also verify the public key size exception (io.jsonwebtoken.security.WeakKeyException) message by checking the logs of the environment you are testing in.
Severity/Priority
- Critical
- High
- Medium
- Low
Additional Information
Checklist
- I have read and followed the project's code of conduct.
- I have searched for similar issues before creating this one.
- I have provided all the necessary information to understand and reproduce the issue.
- I am willing to contribute to the resolution of this issue.