You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/12 10:43:59 UTC

[GitHub] [apisix] idbeta opened a new issue #2725: request help: after enable jwt-auth plugin, route' uri cannot be set to "/*"

idbeta opened a new issue #2725:
URL: https://github.com/apache/apisix/issues/2725


   ### Issue description
   enabled the jwt-auth plugin, if create a route which uri is `/*`, when get the jwt's token will return 401, but the other uri don't have this problem.
   ```shell
   $curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "methods": ["GET"],
       "uri": "/*",
       "plugins": {
           "jwt-auth": {}
       },
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "127.0.0.1:9797": 1
           }
       }
   }'
   ```
   
   get token
   ```
   $curl http://127.0.0.1:9080/apisix/plugin/jwt/sign?key=user-key -i
   HTTP/1.1 401 Unauthorized
   ... ...
   {"message":"Missing JWT token in request"}
   ```
   ### Environment
   
   * apisix version (cmd: `apisix version`): mater
   * OS:
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] membphis commented on issue #2725: request help: after enable jwt-auth plugin, route' uri cannot be set to "/*"

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #2725:
URL: https://github.com/apache/apisix/issues/2725#issuecomment-726228576


   https://github.com/apache/apisix/blob/master/apisix/init.lua#L377-L380
   
   ```
   local user_defined_route_matched = router.router_http.match(api_ctx)
       if not user_defined_route_matched then
           router.api.match(api_ctx)
       end
   ```
   
   change to this, it might work ^_^
   
   ```
       local user_defined_route_matched = router.api.match(api_ctx)
       if not user_defined_route_matched then
           router.router_http.match(api_ctx)
       end
   ```


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] moonming closed issue #2725: bug: after enable jwt-auth plugin, route' uri cannot be set to "/*"

Posted by GitBox <gi...@apache.org>.
moonming closed issue #2725:
URL: https://github.com/apache/apisix/issues/2725


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] membphis commented on issue #2725: request help: after enable jwt-auth plugin, route' uri cannot be set to "/*"

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #2725:
URL: https://github.com/apache/apisix/issues/2725#issuecomment-726227007


   nice report, thx for your report


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org