Skip to content

JWT#

在你的 n8n 工作流中使用 JSON Web Token。

¥Work with JSON web tokens in your n8n workflows.

Credentials

你可以在 此处 中找到此节点的身份验证信息。

¥You can find authentication information for this node here.

操作#

¥Operations

  • 解码

¥Decode

  • 签名

¥Sign

  • 验证

¥Verify

节点参数#

¥Node parameters

This node can be used as an AI tool

This node can be used to enhance the capabilities of an AI agent. When used in this way, many parameters can be set automatically, or with information directed by AI - find out more in the AI tool parameters documentation.

  • 用于连接的凭据:选择或创建要连接的 JWT 凭证

¥Credential to connect with: Select or create a JWT credential to connect with.

  • 令牌:输入要验证或解码的令牌。

¥Token: Enter the token to Verify or Decode.

  • 如果你选择“签名”操作,你还需要输入以下参数:

¥If you select the Sign operation, you'll also have this parameter:

  • 使用 JSON 构建有效负载:启用后,该节点将使用 JSON 构建声明。此处的选择会影响“有效负载声明”部分中显示的内容。

    ¥Use JSON to Build Payload: When turned on, the node uses JSON to build the claims. The selection here influences what appears in the Payload Claims section.

有效负载声明#

¥Payload Claims

仅当你选择“签名”操作时,该节点才会显示有效负载声明。你看到的内容取决于你在“使用 JSON 构建有效负载”中选择的内容:

¥The node only displays payload claims if you select the Sign operation. What you see depends on what you select for Use JSON to Build Payload:

  • 如果你选择“使用 JSON 构建有效负载”,此部分将显示一个 JSON 编辑器,你可以在其中构建声明。

¥If you select Use JSON to Build Payload, this section displays a JSON editor where you can construct the claims.

  • 如果你未选择“使用 JSON 构建有效负载”,则此部分会提示你添加声明。

¥If you don't select Use JSON to Build Payload, this section prompts you to Add Claim.

你可以添加以下声明。

¥You can add the following claims.

受众#

¥Audience

“受众”或“aud”声明标识 JWT 的预期接收者。

¥The Audience or aud claim identifies the intended recipients of the JWT.

有关更多信息,请参阅 "aud"(受众)声明

¥Refer to "aud" (Audience) Claim for more information.

有效期至#

¥Expires In

“过期时间”或“exp”声明标识 JWT 的过期时间,超过此时间后,JWT 将不再被接受进行处理。

¥The Expires In or exp claim identifies the time after which the JWT expires and must not be accepted for processing.

有关更多信息,请参阅 "exp"(过期时间)声明

¥Refer to "exp" (Expiration Time) Claim for more information.

颁发者#

¥Issuer

Issuer 或 iss 声明用于标识 JWT 的发行方。

¥The Issuer or iss claim identifies the principal that issued the JWT.

有关更多信息,请参阅 "iss"(颁发者)声明

¥Refer to "iss" (Issuer) Claim for more information.

JWT ID#

JWT ID 或 jti 声明为 JWT 提供唯一标识符。

¥The JWT ID or jti claim provides a unique identifier for the JWT.

有关更多信息,请参阅 "jti"(JWT ID)声明

¥Refer to "jti" (JWT ID) Claim for more information.

非之前#

¥Not Before

“Not Before”或“nbf”声明用于标识 JWT 必须在此时间之前才能被接受处理。

¥The Not Before or nbf claim identifies the time before which the JWT must not be accepted for processing.

有关更多信息,请参阅 "nbf"(截止日期)声明

¥Refer to "nbf" (Not Before) Claim for more information.

主题#

¥Subject

“主体”或 sub 声明标识作为 JWT 主体的主体。

¥The Subject or sub claim identifies the principal that's the subject of the JWT.

有关更多信息,请参阅 "sub"(主题)声明

¥Refer to "sub" (Subject) Claim for more information.

节点选项#

¥Node options

解码节点选项#

¥Decode node options

“返回附加信息”开关控制节点返回的信息量。

¥The Return Additional Info toggle controls how much information the node returns.

启用后,该节点将返回包含标头和签名信息的完整解码令牌。关闭此选项后,节点仅返回有效负载。

¥When turned on, the node returns the complete decoded token with information about the header and signature. When turned off, the node only returns the payload.

签名节点选项#

¥Sign node options

使用“覆盖算法”控件选择用于验证令牌的算法。此算法将覆盖凭据中选择的算法。

¥Use the Override Algorithm control to select the algorithm to use for verifying the token. This algorithm will override the algorithm selected in the credentials.

验证节点选项#

¥Verify node options

此操作包含多个节点选项:

¥This operation includes several node options:

  • 返回附加信息:此开关控制节点返回的信息量。启用后,该节点将返回包含标头和签名信息的完整解码令牌。关闭此选项后,节点仅返回有效负载。

¥Return Additional Info: This toggle controls how much information the node returns. When turned on, the node returns the complete decoded token with information about the header and signature. When turned off, the node only returns the payload.

  • 忽略过期时间:此开关控制节点是否应忽略令牌的过期时间声明 (exp)。有关更多信息,请参阅 "exp"(过期时间)声明

¥Ignore Expiration: This toggle controls whether the node should ignore the token's expiration time claim (exp). Refer to "exp" (Expiration Time) Claim for more information.

  • 忽略“Not Before”声明:此开关控制是否忽略令牌的“非早于”声明 (nbf)。有关更多信息,请参阅 "nbf"(截止日期)声明

¥Ignore Not Before Claim: This toggle controls whether to ignore the token's not before claim (nbf). Refer to "nbf" (Not Before) Claim for more information.

  • 时钟容差:输入检查 nbfexp 声明时允许的秒数。这使得你可以处理不同服务器之间微小的时钟差异。有关更多信息,请参阅 "exp"(过期时间)声明

¥Clock Tolerance: Enter the number of seconds to tolerate when checking the nbf and exp claims. This allows you to deal with small clock differences among different servers. Refer to "exp" (Expiration Time) Claim for more information.

  • 覆盖算法:用于验证令牌的算法。此算法将覆盖凭据中选择的算法。

¥Override Algorithm: The algorithm to use for verifying the token. This algorithm will override the algorithm selected in the credentials.

模板和示例#

¥Templates and examples

Template widget placeholder.