You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "kayx23 (via GitHub)" <gi...@apache.org> on 2025/07/21 05:43:01 UTC

[PR] docs: update `jwt-auth` docs [apisix]

kayx23 opened a new pull request, #12450:
URL: https://github.com/apache/apisix/pull/12450

   ### Description
   
   This PR updates JWT relevant docs and addresses the following issues:
   
   * HS256 key not long enough, leading to errors.
   * JWT.io front-end has changed. Update instructions.
   * Set environment variable for APISIX in Docker.
   
   ### Checklist
   
   - [x] I have explained the need for this PR and the problem it solves
   - [x] I have explained the changes or the new features added to this PR
   - [ ] I have added tests corresponding to this change
   - [x] I have updated the documentation to reflect this change
   - [ ] I have verified that this change is backward compatible (If not, please discuss on the [APISIX mailing list](https://github.com/apache/apisix/tree/master#community) first)
   
   <!--
   
   Note
   
   1. Mark the PR as draft until it's ready to be reviewed.
   2. Always add/update tests for any changes unless you have a good reason.
   3. Always update the documentation to reflect the changes made in the PR.
   4. Make a new commit to resolve conversations instead of `push -f`.
   5. To resolve merge conflicts, merge master instead of rebasing.
   6. Use "request review" to notify the reviewer after making changes.
   7. Only a reviewer can mark a conversation as resolved.
   
   -->
   


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


Re: [PR] docs: update `jwt-auth` docs [apisix]

Posted by "moonming (via GitHub)" <gi...@apache.org>.
moonming merged PR #12450:
URL: https://github.com/apache/apisix/pull/12450


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


Re: [PR] docs: update `jwt-auth` docs [apisix]

Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on code in PR #12450:
URL: https://github.com/apache/apisix/pull/12450#discussion_r2224616511


##########
docs/zh/latest/plugins/jwt-auth.md:
##########
@@ -517,25 +512,25 @@ curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
   }'
 ```
 
-在 Vault 中将 `jwt-auth` 键值设置为 `jwt-vault-key`:
+在 Vault 中将 `jwt-auth` 键值设置为 `vault-hs256-secret-that-is-very-long`:
 
 ```shell
-docker exec -i vault sh -c "VAULT_TOKEN='root' VAULT_ADDR='http://0.0.0.0:8200' vault kv put kv/apisix/jack jwt-key=jwt-vault-key"
+docker exec -i vault sh -c "VAULT_TOKEN='root' VAULT_ADDR='http://0.0.0.0:8200' vault kv put kv/apisix/jack jwt-secret=vault-hs256-secret-that-is-very-long"
 ```
 
-您应该看到类似于以下内容的响应:
+您应该会看到类似以下内容的响应:
 
 ```text
 Success! Data written to: kv/apisix/jack
 ```
 
-要签发 JWT,您可以使用 [JWT.io 的调试器](https://jwt.io/#debugger-io) 或其他实用程序。如果您使用 [JWT.io 的调试器](https://jwt.io/#debugger-io),请执行以下操作:
+要为 `jack` 颁发 JWT,您可以使用 [JWT.io 的 JWT 编码器](https://jwt.io) 或其他实用程序。如果您使用 [JWT.io 的 JWT 编码器](https://jwt.io),请执行以下操作:
 
-* 在 __Algorithm__ 下拉列表中选择 __HS256__。
-* 将 __Verify Signature__ 部分中的密钥更新为 `vault-hs256-secret` 。
-* 使用消费者密钥 `jwt-vault-key` 更新有效 payload;并在 UNIX 时间戳中添加 `exp` 或 `nbf`。
+* 填写 `HS256` 作为算法。
+* 将 __Valid secret__ 部分中的密钥更新为 `jack-hs256-secret-that-is-very-long`。
+* 使用消费者密钥 `jwt-vault-key` 更新有效 payload;并添加 `exp` 或 `nbf` UNIX 时间戳。

Review Comment:
   fixed



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


Re: [PR] docs: update `jwt-auth` docs [apisix]

Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on PR #12450:
URL: https://github.com/apache/apisix/pull/12450#issuecomment-3101273860

   One more example to update - do not merge just yet. 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


Re: [PR] docs: update `jwt-auth` docs [apisix]

Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop commented on code in PR #12450:
URL: https://github.com/apache/apisix/pull/12450#discussion_r2224593683


##########
docs/zh/latest/plugins/jwt-auth.md:
##########
@@ -517,25 +512,25 @@ curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
   }'
 ```
 
-在 Vault 中将 `jwt-auth` 键值设置为 `jwt-vault-key`:
+在 Vault 中将 `jwt-auth` 键值设置为 `vault-hs256-secret-that-is-very-long`:
 
 ```shell
-docker exec -i vault sh -c "VAULT_TOKEN='root' VAULT_ADDR='http://0.0.0.0:8200' vault kv put kv/apisix/jack jwt-key=jwt-vault-key"
+docker exec -i vault sh -c "VAULT_TOKEN='root' VAULT_ADDR='http://0.0.0.0:8200' vault kv put kv/apisix/jack jwt-secret=vault-hs256-secret-that-is-very-long"
 ```
 
-您应该看到类似于以下内容的响应:
+您应该会看到类似以下内容的响应:
 
 ```text
 Success! Data written to: kv/apisix/jack
 ```
 
-要签发 JWT,您可以使用 [JWT.io 的调试器](https://jwt.io/#debugger-io) 或其他实用程序。如果您使用 [JWT.io 的调试器](https://jwt.io/#debugger-io),请执行以下操作:
+要为 `jack` 颁发 JWT,您可以使用 [JWT.io 的 JWT 编码器](https://jwt.io) 或其他实用程序。如果您使用 [JWT.io 的 JWT 编码器](https://jwt.io),请执行以下操作:
 
-* 在 __Algorithm__ 下拉列表中选择 __HS256__。
-* 将 __Verify Signature__ 部分中的密钥更新为 `vault-hs256-secret` 。
-* 使用消费者密钥 `jwt-vault-key` 更新有效 payload;并在 UNIX 时间戳中添加 `exp` 或 `nbf`。
+* 填写 `HS256` 作为算法。
+* 将 __Valid secret__ 部分中的密钥更新为 `jack-hs256-secret-that-is-very-long`。
+* 使用消费者密钥 `jwt-vault-key` 更新有效 payload;并添加 `exp` 或 `nbf` UNIX 时间戳。

Review Comment:
   The secret values in these two places are inconsistent.



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