Skip to content
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

authentication alway undefined #381

Closed
pepatcha opened this issue Jan 6, 2023 · 3 comments
Closed

authentication alway undefined #381

pepatcha opened this issue Jan 6, 2023 · 3 comments

Comments

@pepatcha
Copy link

pepatcha commented Jan 6, 2023

After updated from 10.2.0 to 10.4.0 my authentication function alway failed

@nelsonic
Copy link
Member

nelsonic commented Jan 6, 2023

@pepatcha thanks for opening this issue. If you don’t mind adding a bit more detail so we can try and write a regression test for this. 🙏

@pepatcha
Copy link
Author

pepatcha commented Jan 6, 2023

my bad after I tracked my code I found that is an algorithm problems.

I am using HS256 algorithm and my secret key was something like
-----BEGIN RSA PRIVATE KEY----- xxxxxxxxxxxxxxxxx xxxxxxxxxxxxxx..... -----END RSA PRIVATE KEY-----

It was fine when I used hapi-auth-jwt2 version 10.2.0, but after I upgraded to version 10.4.0 I got this error
JsonWebTokenError: secretOrPublicKey must be a symmetric key when using HS256

after I changed my key everything is fine

@nelsonic thanks for your response

@pepatcha pepatcha closed this as completed Jan 6, 2023
@nelsonic
Copy link
Member

nelsonic commented Jan 6, 2023

@pepatcha thanks for updating. 👍
Glad you were able to re-trace your steps and figure it out. 🔍
And especially stoked that you've confirmed that v10.4.0 is working for you. 🎉
Hope you have a great day. ☀️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants