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 2021/03/29 04:44:26 UTC

[GitHub] [apisix] KMFtcy opened a new issue #3928: request help: why my gateway ask for jwt when I do not set any authentication method.

KMFtcy opened a new issue #3928:
URL: https://github.com/apache/apisix/issues/3928


   ### Issue description
   Hi there!
   I'm running apisix in a docker container. The docker image built from project https://github.com/apache/apisix-docker with command below
   ```
   docker build --build-arg APISIX_VERSION=2.3 --build-arg APISIX_DASHBOARD_VERSION=v2.4 -t apache/apisix-dashboard:whole -f ./all-in-one/apisix-dashboard/Dockerfile .
   ```
   But when I access one route, it says:
   ```
   {"message":"Missing JWT token in request"}
   ```
   But I set no plugin at all.
   
   Here is my apisix config
   ```
   apisix:
     node_listen: 28888                # APISIX listening port
   ```
   And here's what returns when execute ”curl "http://localhost:28888/apisix/admin/routes/" -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' | jq”
   ```
   {
     "node": {
       "key": "/apisix/routes",
       "dir": true,
       "nodes": [
         {
           "createdIndex": 435,
           "key": "/apisix/routes/347805553193389723",
           "value": {
             "vars": {},
             "uris": [
               "/grafana/*"
             ],
             "update_time": 1616917694,
             "upstream_id": "347806311959760539",
             "hosts": [
               "***" # a normal host
             ],
             "status": 1,
             "id": "347805553193389723",
             "methods": [
               "GET",
               "HEAD",
               "POST",
               "PUT",
               "DELETE",
               "OPTIONS",
               "PATCH"
             ],
             "create_time": 1616837864,
             "name": "grafana"
           },
           "modifiedIndex": 1794
         },
   ......
       ]
     },
     "count": "1",
     "action": "get"
   }
   
   ```
   And this is what it returns when I execute "curl localhost:28888/grafana/ -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1"
   ```
   {"message":"Missing JWT token in request"}
   ```
   Please tell me how to turn off JWT authentication.
   ### Environment
   
   * apisix version (cmd: `apisix version`): build from master
   * OS (cmd: `uname -a`): Linux 6a472e73906d 5.4.0-67-generic #75-Ubuntu SMP Fri Feb 19 18:03:38 UTC 2021 x86_64 Linux (run in docker) 
   * OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`): openresty/1.19.3.1
   * etcd version, if have (cmd: run `curl http://127.0.0.1:9090/v1/server_info` to get the info from server-info API): 3.4
   * apisix-dashboard version, if have:
   


-- 
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] KMFtcy commented on issue #3928: request help: why my gateway ask for jwt when I do not set any authentication method.

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


   And By the way, I have tried to create a consumer but it always says `invalid json data` like this:
   ![image](https://user-images.githubusercontent.com/41932086/112797525-1797f800-909e-11eb-9095-7111cd1dd60c.png)
   


-- 
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] KMFtcy commented on issue #3928: request help: why my gateway ask for jwt when I do not set any authentication method.

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


   @tokers No. Is it necessary to bind a consumer to a route?


-- 
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] Firstsawyou commented on issue #3928: request help: why my gateway ask for jwt when I do not set any authentication method.

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


   @KMFtcy 
   You need to check the following two points:
   1. Is the jwt-auth plugin configured in your consumer object? If so, you need to check whether the jwt-auth plugin is enabled in the route?
   2. Is the jwt-auth plugin enabled in `global_rules`?


-- 
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] tokers commented on issue #3928: request help: why my gateway ask for jwt when I do not set any authentication method.

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


   @KMFtcy Is there any consumer data in your APISIX?


-- 
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] KMFtcy edited a comment on issue #3928: request help: why my gateway ask for jwt when I do not set any authentication method.

Posted by GitBox <gi...@apache.org>.
KMFtcy edited a comment on issue #3928:
URL: https://github.com/apache/apisix/issues/3928#issuecomment-809124123


   Gentlemen, I have located the problems. I found I accidentally I enable a plugin in this page.
   ![image](https://user-images.githubusercontent.com/41932086/112798006-d7854500-909e-11eb-80ed-ed1ffc942f54.png)
   When I delete it , the error is gone. Sorry for my faults.
   And the `invalid json data` problem was fixed when I paste this, coyied from `https://github.com/apache/apisix/blob/master/docs/zh/latest/plugins/jwt-auth.md`
   ```
   {
               "key": "user-key",
               "secret": "my-secret-key"
           }
   ```
   Thanks for all your helps. @tokers @Firstsawyou 


-- 
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] KMFtcy commented on issue #3928: request help: why my gateway ask for jwt when I do not set any authentication method.

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


   @Firstsawyou 
   Thanks for your reply.
   
   1. I have check and I'm sure jwt-auth is not enabled in my routes.
   2. Where can I config `global_rules` ? I cannot find it in `config-default.yaml`


-- 
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] KMFtcy closed issue #3928: request help: why my gateway ask for jwt when I do not set any authentication method.

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


   


-- 
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] KMFtcy commented on issue #3928: request help: why my gateway ask for jwt when I do not set any authentication method.

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


   Gentlemen, I have located the problems. I found I accidentally I enable a plugins in this page.
   ![image](https://user-images.githubusercontent.com/41932086/112798006-d7854500-909e-11eb-80ed-ed1ffc942f54.png)
   When I delete it , the error is gone. Sorry for my faults.
   And the `invalid json data` problem was fixed when I paste this, coyied from `https://github.com/apache/apisix/blob/master/docs/zh/latest/plugins/jwt-auth.md`
   ```
   {
               "key": "user-key",
               "secret": "my-secret-key"
           }
   ```
   Thanks for all your helps. @tokers @Firstsawyou 


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