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/09/07 07:56:33 UTC

[GitHub] [apisix] ztgoto opened a new issue #5005: admin api request unauthorized(4107)

ztgoto opened a new issue #5005:
URL: https://github.com/apache/apisix/issues/5005


   ### Issue description
   
   `
   #curl -XPUT -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' 'http://127.0.0.1:8999/apisix/admin/routes/1' -d '{
       "uri": "/baseauth/*",
       "upstream": {
           "service_name": "baseauth",
           "type": "roundrobin",
           "discovery_type": "nacos",
           "discovery_args": {
             "namespace_id": "3072804a-e201-4867-a10a-a5fbf2eba3c7",
             "group_name": "DEFAULT"
           }
       }
   }'
   {"code":4107,"message":"request unauthorized","data":null,"request_id":""}
   `
   
   config.yaml
   `
   apisix:
     allow_admin:
       - 0.0.0.0/0
     admin_key:
       - name: admin
         key: edd1c9f034335f136f87ad84b625c8f1  
         role: admin
   `
   
   
   
   ### Environment
   
   - apisix version (cmd: `apisix version`):  2.8
   - OS (cmd: `uname -a`):  Linux 119 3.10.0-957.5.1.el7.x86_64 #1 SMP Fri Feb 1 14:54:57 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
   - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
   - etcd version, if have (cmd: run `curl http://127.0.0.1:9090/v1/server_info` to get the info from server-info API): nginx version: openresty/1.19.3.2
   - apisix-dashboard version, if have:
   - luarocks version, if the issue is about installation (cmd: `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

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



[GitHub] [apisix] Zheaoli commented on issue #5005: admin api request unauthorized(4107)

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


   It seems like that you don't use the correct port. the default port is 9080 if you have not set the port in the `config.yml`


-- 
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] ztgoto commented on issue #5005: admin api request unauthorized(4107)

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


   > It seems like that you don't use the correct port. the default port is 9080 if you have not set the port in the `config.yml`
   > 
   > maybe you can try
   > 
   > ```shell
   > curl -XPUT -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' 'http://127.0.0.1:9080/apisix/admin/routes/1' -d '{
   >     "uri": "/baseauth/*",
   >     "upstream": {
   >         "service_name": "baseauth",
   >         "type": "roundrobin",
   >         "discovery_type": "nacos",
   >         "discovery_args": {
   >           "namespace_id": "3072804a-e201-4867-a10a-a5fbf2eba3c7",
   >           "group_name": "DEFAULT"
   >         }
   >     }
   > }'
   > ```
   
   Yes, Thanks!


-- 
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] Zheaoli edited a comment on issue #5005: admin api request unauthorized(4107)

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


   It seems like that you don't use the correct port. the default port is 9080 if you have not set the port in the `config.yml`
   
   maybe you can try 
   
   ```bash
   curl -XPUT -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' 'http://127.0.0.1:9080/apisix/admin/routes/1' -d '{
       "uri": "/baseauth/*",
       "upstream": {
           "service_name": "baseauth",
           "type": "roundrobin",
           "discovery_type": "nacos",
           "discovery_args": {
             "namespace_id": "3072804a-e201-4867-a10a-a5fbf2eba3c7",
             "group_name": "DEFAULT"
           }
       }
   }'
   
   ```


-- 
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] spacewander closed issue #5005: admin api request unauthorized(4107)

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


   


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