tzssangglass commented on issue #6936:
URL: https://github.com/apache/apisix/issues/6936#issuecomment-1111777546

   here is my reproduction steps:
   
   ### config.yaml
   
   ```yaml
   apisix:
     admin_key:
       - name: admin
         key: edd1c9f034335f136f87ad84b625c8f1  # using fixed API token has 
security risk, please update it when you deploy to production environment
         role: admin
     admin_listen:
      ip: 127.0.0.1
      port: 9180
   ```
   
   ### add consumer
   
   ```shell
   $ curl http://127.0.0.1:9180/apisix/admin/consumers -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "username": "jack",
       "plugins": {
           "jwt-auth": {
               "key": "user-key",
               "secret": "my-secret-key"
           }
       }
   }'
   ```
   
   ### register uri in public API
   
   ```
   $ curl -X PUT 'http://127.0.0.1:9180/apisix/admin/routes/r1' \
       -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' \
       -H 'Content-Type: application/json' \
       -d '{
       "uri": "/apisix/plugin/jwt/sign",
       "plugins": {
           "public-api": {}
       }
   }'
   ```
   
   ### get JWT
   
   ```shell
   $ curl 'http://127.0.0.1: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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to