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

bug: When we use the jwt-auth plugin, no matter how much the exp in the payload is set to, the actual token expiration time will be the current time + the default expiration time (1 day) #11650

Closed
fanyu-byte opened this issue Oct 15, 2024 · 2 comments
Labels
bug Something isn't working plugin

Comments

@fanyu-byte
Copy link

Current Behavior

When we use the jwt-auth plugin, no matter how much the exp in the payload is set to, the actual token expiration time will be the current time + the default expiration time (1 day)

Expected Behavior

the token expiretime should same as which i configed in the payload

Error Logs

No response

Steps to Reproduce

  1. start apisix and jwt-plugin

  2. generage jwt-token and write payload contains exp , such as
    curl -G --data-urlencode 'payload={"uid":10000,"uname":"test","exp":1728976481}' http://127.0.0.1:9080/apisix/plugin/jwt/sign?key=merchant-key

  3. Parse the token to check the exp and see if it is consistent with the expectation.

Environment

  • APISIX version (run apisix version): 3.10.0
  • Operating system (run uname -a): wsl2.0
  • 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):
@fanyu-byte
Copy link
Author

please review this pr
#11653

@moonming
Copy link
Member

The exp used in the API for issuing tokens on the data plane comes from the plugin configuration, not specified in the payload, so this issue is expected.
In the latest code of Apache APISIX, the JWT signature function has been removed. You can use a third-party tool to generate a signature and verify it in the API gateway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working plugin
Projects
Archived in project
Development

No branches or pull requests

2 participants