feipengheart opened a new issue #5281:
URL: https://github.com/apache/apisix/issues/5281


   ### Issue description
   
   jwt-auth设置公钥和私钥,请求到的token不能用,返回{"message":"Decode secret is not a valid 
cert\/public key: no start line"}
   
   设置如下:
   {
     "username": "kerouac",
     "plugins": {
       "jwt-auth": {
         "algorithm": "RS256",
         "disable": false,
         "exp": 86400,
         "key": "user-key-test",
         "private_key": "-----BEGIN RSA PRIVATE 
KEY-----\nMIIBPAIBAAJBAIw48ajnqOsJSTBtg84hHI1bvezI/rV/mwNZ7JT0nie/UAAJ6/XO\nJmj+GpQU8KQ4TivWtdUy++U9DdQMvnVCyD8CAwEAAQJAaGhmGBwWPJu3cWW6BJvH\nBMJQ0qR+c2pGY+JrNCZHzBCegBQYYHakeBAAkdqrE7kB2pDbk5Q4Wh8ZIR8ICt3X\nYQIjAIyzjudud40fDwJnHDdErccF3yDYzi6QnRyJnd5RSmsL/XkCHwD/IOinAetg\nhm001bjHLIOQmJbzDk6IQVd8zvyzXXcCIn5WsOfQglreW5zdtzFNYvkFpbAZ3TFk\nux6n13CL79WlI4kCHlKha/i7TGrE3xXfqqsHpcztPuaV2aWT1CweNgY53QIjAIoU\nJuW/0F0G9rY2LCEoxer2AXtriP1CQ4ImNSKgl0hTSPU=\n-----END
 RSA PRIVATE KEY-----",
         "public_key": "-----BEGIN RSA PUBLIC 
KEY-----\nMEgCQQCMOPGo56jrCUkwbYPOIRyNW73syP61f5sDWeyU9J4nv1AACev1ziZo/hqU\nFPCkOE4r1rXVMvvlPQ3UDL51Qsg/AgMBAAE=\n-----END
 RSA PUBLIC KEY-----"
       }
     }
   }
   请求token:
   
![image](https://user-images.githubusercontent.com/66514726/137850930-a848ac70-3bd7-4cd9-9f7c-92799d6c6ec5.png)
   
   报错:
   
![image](https://user-images.githubusercontent.com/66514726/137850966-64dba2bb-5cfa-419b-8bef-7929d155fc3d.png)
   
   
   ### Environment
   
   - apisix version (cmd: `apisix version`):
   - OS (cmd: `uname -a`):
   - 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):
   - apisix-dashboard version, if have:
   - the plugin runner version, if the issue is about a plugin runner (cmd: 
depended on the kind of runner):
   - 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: [email protected]

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


Reply via email to