You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "thor533 (via GitHub)" <gi...@apache.org> on 2023/04/12 08:02:19 UTC

[GitHub] [apisix] thor533 opened a new issue, #9294: failed to sign jwt

thor533 opened a new issue, #9294:
URL: https://github.com/apache/apisix/issues/9294

   ### Description
   
   i use the jwt-auth plugin,i set the config such as :
   
   { "username": "Jwt_auth", "plugins": { "jwt-auth": { "algorithm": "RS256", "base64_secret": true, "disable": false, "exp": 100, "key": "yc", "private_key": "-----BEGIN RSA PRIVATE KEY-----MIIEpAIBAAKCAQEAwKv3wDkp94sxfUKarg4MuiB2hy21XqDZD5zS1uLO4Bu8ojcKeP6K5pHQqplHUZqtn2J+X2BvbXjQ7On4+7Do1PrCTWcEVC5iLttwJgZI/IjGIyZB/11rJAQkJjhJ/GGBpNm3lYG3BWiosgeGUXeJYRUDSs/LP3wi9odAoutH6nS1E/9fnBE7HUm0tfk4XJvnDepgkYEWQCSp8LomjdBWKMfo5k6r7xYNvgRk+lQbOVC+87kB15hQVLpefS/G39M26qIbPAq2xj70UBlAQxSI3dgTvsknxF/gaNq4RU0ADHVS0vluzSFRJwA+A9FyKhAQME7M7++9MsFX7ofdoGYxVQIDAQABAoIBAQCVU3LT1zoQch/sDffmGFuC0fArOqDL82vnrsq14tklVjnvmysRtW4f3zlTTzK4K2KPGf4Jm6sgtDdwtrHTGDyL/MEkzkfLmptb55TW054zoym1SkxyR4vnQRJnUM7+vO+GvXqMdBlOJtxABpbyguvFg0ym6b+Dt4k9env9CM8XBP5N/5INsuTZg9Qa0A7s8/ngrkwuy9kwqiWtJP/gci+NCIXgblC4rreWN84Xlt0tJSfShk20PzHoyjqYCDXkAxdJe0GSYS7vqSBSC/YZEqHdCOktcYkZ3UZAftMASlmJmPyFqRFK1l7yBWHYW3LddnPLSflecpLySnNBropurr8hAoGBAOgs5ds+vWyX7D2MgPQ5Y5+BVrpUQbUrhFfCia80Cu8WXpD1ydlzu7XYaoRAXyXi/sALRJR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yc" } }, "create_time": 1679901133, "update_time": 1679968952, "consumerNameStr": "jwt-auth" }
   
   ps: The certificate is correct ,is pem format.
   when i request the api:use postman:
   http://10.4.16.105:9080/apisix/plugin/jwt/sign?key=yc
   the response is :failed to sign jwt
   
   
   
   error log:
   *9621032 [lua] jwt-auth.lua:328: sign_handler(): failed to sign jwt, err: signer error: no start line, client: 192.168.88.66, server: _, request: "GET /apisix/plugin/jwt/sign?key=yc123 HTTP/1.1", host: "10.4.16.105:9080"
   
   
   please help me! thanks !
   
   ### Environment
   
   - APISIX version (run `apisix 2.15-alpine`):
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `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.apache.org

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


[GitHub] [apisix] nic-6443 commented on issue #9294: failed to sign jwt

Posted by "nic-6443 (via GitHub)" <gi...@apache.org>.
nic-6443 commented on issue #9294:
URL: https://github.com/apache/apisix/issues/9294#issuecomment-1506196170

   Your certificate and private key are invalid. In PEM format, the starting and ending lines before and after the content section need to be separated by newline. 
   For example:
   ```
   -----BEGIN RSA PRIVATE KEY-----\nMIIEp.....
   ```
   rather than:
   ```
   -----BEGIN RSA PRIVATE KEY-----MIIEp.....
   ```


-- 
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] thor533 commented on issue #9294: failed to sign jwt

Posted by "thor533 (via GitHub)" <gi...@apache.org>.
thor533 commented on issue #9294:
URL: https://github.com/apache/apisix/issues/9294#issuecomment-1506266235

   > Your certificate and private key are invalid. In PEM format, the starting and ending lines before and after the content section need to be separated by newline. For example:
   > 
   > ```
   > -----BEGIN RSA PRIVATE KEY-----\nMIIEp.....
   > ```
   > 
   > rather than:
   > 
   > ```
   > -----BEGIN RSA PRIVATE KEY-----MIIEp.....
   > ```
   big boss,Can you help me with this problem? Thank you very much
   ##9202
   
   
   
   


-- 
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] thor533 commented on issue #9294: failed to sign jwt

Posted by "thor533 (via GitHub)" <gi...@apache.org>.
thor533 commented on issue #9294:
URL: https://github.com/apache/apisix/issues/9294#issuecomment-1506233601

   > Your certificate and private key are invalid. In PEM format, the starting and ending lines before and after the content section need to be separated by newline. For example:
   > 
   > ```
   > -----BEGIN RSA PRIVATE KEY-----\nMIIEp.....
   > ```
   > 
   > rather than:
   > 
   > ```
   > -----BEGIN RSA PRIVATE KEY-----MIIEp.....
   > ```
   
   okey  you are right,thank you very much!


-- 
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] nic-6443 closed issue #9294: failed to sign jwt

Posted by "nic-6443 (via GitHub)" <gi...@apache.org>.
nic-6443 closed issue #9294: failed to sign jwt
URL: https://github.com/apache/apisix/issues/9294


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