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

Jwt invalid algorithm #116

Open
nayyaung9 opened this issue Aug 22, 2021 · 2 comments
Open

Jwt invalid algorithm #116

nayyaung9 opened this issue Aug 22, 2021 · 2 comments

Comments

@nayyaung9
Copy link

nayyaung9 commented Aug 22, 2021

I have got token from user signIn & signUp function. But when i set token in headers authorization, It returns

{
  "message": "invalid algorithm"
}

i am so curious to know what this is happening.
Also I double check config values are already loaded.

Thank you.

@swizes
Copy link

swizes commented Aug 24, 2021

const isAuth = jwt({
  secret: config.jwtSecret, // The _secret_ to sign the JWTs
  algorithms: ['HS256'], // JWT Algorithm
  userProperty: 'token', // Use req.token to store the JWT
  getToken: getTokenFromHeader, // How to extract the JWT from the request
});

Change algorithms value to the example I posted above

@arvindgemini
Copy link

It is working with HS256 Algorithm

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

3 participants