You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "wzxmt (via GitHub)" <gi...@apache.org> on 2023/04/28 02:52:00 UTC
[GitHub] [apisix] wzxmt opened a new issue, #9390: help request: jwt-auth returns 404 for obtaining the token
wzxmt opened a new issue, #9390:
URL: https://github.com/apache/apisix/issues/9390
### Description
Deploy apisix through helm,helm pull apisix/apisix --untar download configuration, add public-api plug-in under plugins,helm deployment.
k8s: v1.24.2
helm: v3.11.2
apisix: 1.3.1
Create consumer successfully!
```
curl http://10.96.65.152:9180/apisix/admin/consumers \
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"username": "jack",
"plugins": {
"jwt-auth": {
"key": "user-key",
"secret": "my-secret-key"
}
}
}'
```
Return value:
```
{"value":{"update_time":1682649534,"plugins":{"jwt-auth":{"secret":"my-secret-key","exp":86400,"base64_secret":false,"lifetime_grace_period":0,"key":"user-key","algorithm":"HS256"}},"username":"jack","create_time":1682647745},"key":"/apisix/consumers/jack"}
```
Exposed sign interface:
```
curl http://10.96.65.152:9180/apisix/admin/routes/jas \
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"uri": "/apisix/plugin/jwt/sign",
"plugins": {
"public-api": {}
}
}'
```
Return value:
```
{"value":{"update_time":1682649614,"plugins":{"public-api":{}},"id":"jas","uri":"/apisix/plugin/jwt/sign","priority":0,"create_time":1682648444,"status":1},"key":"/apisix/routes/jas"}
```
However, obtaining the token failed!!!!
```
curl 'http://10.96.65.152:9180/apisix/plugin/jwt/sign?key=user-key'
```
Return value:
```
[root@m1 ~]# curl 'http://10.96.65.152:9180/apisix/plugin/jwt/sign?key=user-key'
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>openresty</center>
<p><em>Powered by <a href="https://apisix.apache.org/">APISIX</a>.</em></p></body>
</html>
```
### Environment
- APISIX version (run `apisix version`): 3.2.0
- Operating system (run `uname -a`): helm deployment in k8s environment
- 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`):
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] shreemaan-abhishek commented on issue #9390: help request: jwt-auth returns 404 for obtaining the token
Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on issue #9390:
URL: https://github.com/apache/apisix/issues/9390#issuecomment-1527115867
You are using the wrong port `9180`. Use `9080` instead.
This should work `curl 'http://10.96.65.152:9080/apisix/plugin/jwt/sign?key=user-key'`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] wzxmt closed issue #9390: help request: jwt-auth returns 404 for obtaining the token
Posted by "wzxmt (via GitHub)" <gi...@apache.org>.
wzxmt closed issue #9390: help request: jwt-auth returns 404 for obtaining the token
URL: https://github.com/apache/apisix/issues/9390
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] wzxmt commented on issue #9390: help request: jwt-auth returns 404 for obtaining the token
Posted by "wzxmt (via GitHub)" <gi...@apache.org>.
wzxmt commented on issue #9390:
URL: https://github.com/apache/apisix/issues/9390#issuecomment-1527482142
thanks!
I entered the pod container successfully。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org