Field Name | Field Description |
uri param names | List of Query parameters used to obtain the JWT token. This field is configured when the JWT token is configured in the URI. |
cookies names | List of Cookie parameters used to obtain the JWT token. This field is configured when the JWT token is configured in Cookie. |
key claim name | Key value of the credential, corresponding to the JWT Claim content, which is set to iss by default. |
secret is base64 | Whether the secret of the credential is base64-encoded. |
claims to verify | Claims verified by Cloud Native API Gateway, which can be exp or nbf. |
anonymous | Whether a request is submitted to an anonymous consumer to process when authentication fails. It is empty by default, indicating that a 4xx response is returned when the request fails. |
run on preflight | Whether the plugin should run its logic on OPTIONS preflight requests (and attempt to authenticate the identity). If it is set to false, OPTIONS requests are always allowed. |
maximum expiration | JWT token expiration time, ranging from 0 to 31536000 (365 days). When this field is specified, you need to specify exp in claims to verify. The default value is 0, indicating indefinite. When the token expires, the request is denied with HTTP 403. Note that potential clock drift should be considered when this field is configured. |
header names | List of header parameters used to obtain the JWT token. This field is configured when the JWT token is configured in the URI. |

Configuration Item | Description |
key | Corresponding to the issuer of JWT Claims. If it is not specified, a key is generated automatically. |
algorithm | Encryption algorithm used for the JWT token signature, which can be HS256 or RS256. In this scenario, it is set to HS256. |
secret | Secret set for signature verification when the signature algorithm is HS256. If it is not specified, a secret is generated automatically. |





curl -i xxxxxxx/testHTTP/1.1 401 UnauthorizedConnection: keep-aliveContent-Length: 26Content-Type: application/json; charset=utf-8Date: Tue, 29 Nov 2022 12:55:33 GMTServer: kong/2.5.1X-Kong-Response-Latency: 23{"message":"Unauthorized"}
curl -i 'http://xxxxxx/test' \\--header 'Authorization: Bearer eyJhbGciOixxxxxxxxxxI6IkpXVCJ9.eyJpc3MiOiJoUXY4eGRtWxxxxxxxxxxxzFoQ0VUQnNySiJ9.APz7Kx9eIiV1CxAJUVt4i4-gvsJ56TtPxxxxxxK67VQ'HTTP/1.1 200 OKConnection: keep-aliveContent-Type: application/json; charset=utf-8Date: Tue, 29 Nov 2022 12:57:38 GMTServer: apigw/1.0.15Vary: Accept-EncodingVia: kong/2.5.1X-Api-Id: api-1nxxxxkucX-Api-Requestid: ab873xxxxd68cac394ddc208X-Kong-Proxy-Latency: 7X-Kong-Upstream-Latency: 6Content-Length: 11hello Kong

Configuration Item | Description |
key | Corresponding to the issuer of JWT Claims. If it is not specified, a key is generated automatically. |
algorithm | Encryption algorithm used for JWT token signature, which can be HS256 or RS256. In this scenario, it is set to RS256. |
rsa_public_key | Public key (PEM format) set for signature verification when the signature algorithm is RS256. |
secret | Private key (PEM format) set for signature verification when the signature algorithm is RS256. |





curl -i xxxxxxx/testrsaHTTP/1.1 401 UnauthorizedConnection: keep-aliveContent-Length: 26Content-Type: application/json; charset=utf-8Date: Tue, 29 Nov 2022 12:55:33 GMTServer: kong/2.5.1X-Kong-Response-Latency: 23{"message":"Unauthorized"}
curl -i 'http://xxxxxx/testrsa' \\--header 'Authorization: Bearer eyJhbGciOixxxxxxxxxxI6IkpXVCJ9.eyJpc3MiOiJoUXY4eGRtWxxxxxxxxxxxzFoQ0VUQnNySiJ9.APz7Kx9eIiV1CxAJUVt4i4-gvsJ56TtPxxxxxxK67VQ'HTTP/1.1 200 OKConnection: keep-aliveContent-Type: application/json; charset=utf-8Date: Tue, 29 Nov 2022 12:57:38 GMTServer: apigw/1.0.15Vary: Accept-EncodingVia: kong/2.5.1X-Api-Id: api-1nxxxxkucX-Api-Requestid: ab873xxxxd68cac394ddc208X-Kong-Proxy-Latency: 7X-Kong-Upstream-Latency: 6Content-Length: 11hello Kong
フィードバック