Enhance jwt-auth Plugin with Configurable Claim Name and Support for Asymmetric Algorithms #11511
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a new feature and several enhancements to the
jwt-auth
plugin in Apache APISIX. The key change is the addition of a configurablekey_claim_name
parameter, which allows users to specify the JWT claim used for identifying the user. This provides greater flexibility and enables integration with a wider variety of JWT issuers and token structures.Key Changes:
key_claim_name
): Users can now specify which claim in the JWT payload should be used to identify the user (e.g.,iss
for the issuer claim).RS256
,ES256
): The plugin now supports JWTs signed with asymmetric algorithms, with new configuration fields forpublic_key
andprivate_key
.This change addresses the following:
Fixes: Issue #11276
Checklist