Error: RSA signing keys must be PrivateKey instances

When i try to post my login with user and password, the only return is:
RSA signing keys must be PrivateKey instances.

What should i do to solve it?

1 Like

Hey there @lucascardozo73 welcome to the community!

Are you able to elaborate a bit here on where and how exactly you are getting this error? The more details you can provide the better.

Thanks!

So, i am trying to implement this new way of authentication, and i was following this one tutorial:

my code is pretty much exactly the same as displayed, only changed the user and password.

but, when i try to run a request using insomnia, it returns the error, like this:

Just fixed it, turns out i was using Keys.hmacShaKeyFor with the Signature Algorithm RS512, just changed it to HS256 and it solved the problem

2 Likes

Hey @lucascardozo73 that’s great! I’m glad to hear you were able to resolve this and thanks for following up with the community :smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.