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.lua": HS256 signature validation fails which reason as "internal error" #81

Open
sanjamoh19781 opened this issue May 31, 2018 · 9 comments

Comments

@sanjamoh19781
Copy link

sanjamoh19781 commented May 31, 2018

My env:

After debug i stuck up at hmac.lua at function _M.new(self, key, hash_algo). It seems it returns "nil' to the caller in JWT.lua.
I doubt something going worng with 'require "ffi"' in hmac.lua, though not sure.

Log snippet from nginx error.log:
2018/05/30 13:42:41 [warn] 11009#11009: *1 [lua] jwt.lua:109: my signsecret3, client: 127.0.0.1, server: , request: "POST /pps/v3/core/bookings/createEventBooking HTTP/1.1", host: "localhost:8080"
2018/05/30 13:42:41 [warn] 11009#11009: *1 [lua] hmac.lua:92: new(): inside hmac(in new)secret3, client: 127.0.0.1, server: , request: "POST /pps/v3/core/bookings/createEventBooking HTTP/1.1", host: "localhost:8080"
2018/05/30 13:42:41 [warn] 11009#11009: *1 [lua] nginx-jwt.lua:51: auth(): Invalid token: internal error, client: 127.0.0.1, server: , request: "POST /pps/v3/core/bookings/createEventBooking HTTP/1.1", host: "localhost:8080"

Any help appreciated?

Thanks,
Sanjay

@sanjamoh19781 sanjamoh19781 changed the title "jwt.lua": HS256 signature validation fails which reason as "unknown error" "jwt.lua": HS256 signature validation fails which reason as "internal error" May 31, 2018
@albertaparicio
Copy link

albertaparicio commented May 31, 2018

I am having the same problem here. OpenResty version is 1.13.6.2

I am trying to verify a JWT token (I can verify it in jwt.io), but the result is negative, with HS256 algorithm and reason 'internal error'.

Any ideas on when has this started to happen?

Thanks

@albertaparicio
Copy link

I have downgraded the openresty, openresty-opm and openresty-resty packages back to version 1.13.6.1 and it all works fine.

@sanjamoh19781
Copy link
Author

Apologies for not seeing the post since long. Thank you @albertaparicio for the info. Infact i had tried with a older version before, still it did not work. Let me see to do it with a new VM.

@cliveeisen
Copy link

Replace the hmac.lua (sum 48606) with the one at https://github.com/jkeys089/lua-resty-hmac
(sum 54340) and it all works again

@dolivervl
Copy link

@cliveeisen Thank you, u tip works for me !!!!

@and1990
Copy link

and1990 commented Aug 3, 2018

I have meet this problem. Downgrade the Openresty version works for me.

My case:

  1. It worked fine with Openresty version 1.11.2.5.
  2. Then I upgraded Openresty, its version is 1.13.6.1.
  3. It showed 'internal error' when i used JWT library to verify user's token. I had tried multiple ways to solve this problem, but none of them worked.
  4. Finally, I returned back to 1.11.2.5 , everything is ok.

@lwhile
Copy link

lwhile commented Feb 13, 2019

The OpenSSL version used by Openresty 1.13.6.2 was upgraded to 1.1.0.

Must upgrade the dependent of lua-resty-hmac.

@zandbelt
Copy link
Contributor

see #85 for the alternative repo for this lib

fghpdf added a commit to shimohq/lua-resty-jwt that referenced this issue Feb 25, 2019
wujunze added a commit to orlabs/orange that referenced this issue Mar 22, 2019
hotfix   jwt  plugin   
more see  SkyLothar/lua-resty-jwt#81
@EtachGu
Copy link

EtachGu commented May 25, 2019

Replace the hmac.lua (sum 48606) with the one at https://github.com/jkeys089/lua-resty-hmac
(sum 54340) and it all works again

after replace hmac.lua, it works

EtachGu added a commit to EtachGu/lua-resty-jwt that referenced this issue May 25, 2019
jewel528 pushed a commit to jewel528/orange that referenced this issue Feb 15, 2024
hotfix   jwt  plugin   
more see  SkyLothar/lua-resty-jwt#81
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

8 participants