Skip to content

jwt-auth plugins use is failed to verify jwt #8909

@githubxubin

Description

@githubxubin

Description

jwt-auth plugins use:
http://url?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjM1NTIyMTk4NTQsImtleSI6Imp3dF9rZXkifQ.Tr9OvZG_ZadNCWoMqkisQ0u5DagqyArZykl6AgDUnlA

the token is true but response is {"message":"failed to verify jwt"}.
version:
apache/apisix:2.15.0-alpine
apache/apisix-dashboard:2.13-alpine
bitnami/etcd:3.4.15

jwt config:
{
"username": "consumer_jwt",
"desc": "consumer_jwt",
"plugins": {
"jwt-auth": {
"exp": 1879318541,
"key": "jwt_key"
}
}
}

i use the Authorization:
[root@localhost example]# curl http://127.0.0.1:9080/test1/ -H 'Authorization:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJqd3Rfa2V5IiwiZXhwIjoxNjc3MTMwNjM2fQ.HW-_czVK-ECTu9JPUYDbTGYYGNJjSZczoIiW1_Glvag' -i
HTTP/1.1 401 Unauthorized
Date: Wed, 22 Feb 2023 05:37:59 GMT
Content-Type: text/plain; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Server: APISIX/2.15.0

{"message":"failed to verify jwt"}

Environment

  • APISIX version 2.15
  • Operating system (run uname -a):
  • OpenResty / Nginx version (run openresty -V or nginx -V):
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions