You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "mikyll (via GitHub)" <gi...@apache.org> on 2024/05/22 13:23:28 UTC

[I] feat: As a user, I'd like to use "iss" JWT claim to verify my Apisix Consumers [apisix]

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

   ### Description
   
   I'd like to extend a little [jwt-auth plugin](https://github.com/apache/apisix/blob/master/apisix/plugins/jwt-auth.lua) to add a new configuration parameter:
   - `key_claim_name` (default value: `key`). that can be used to specify a different key claim name, to validate the JWT against an Apisix Consumer.
   
   Lil snippet for reference:
   ```lua
   function _M.rewrite(conf, ctx)
       -- [...]
   
       local key_claim_name = conf.key_claim_name
       local user_key = jwt_obj.payload and jwt_obj.payload[key_claim_name]
       if not user_key then
           return 401, {message = "Missing " .. key_claim_name .. " claim in JWT token"}
       end
   
       -- [...]
   end
   ```
   
   Since it would be set to `key` by default, it shouldn't change/break any existing setting, but would be helpful for those who are using different JWT "formats".
   
   For example, the company I'm working at is using `iss` claim as Consumer key. Since we're already using a custom version of the jwt-auth plugin (with this feature implemented), I'd like to integrate this contribution to the official plugin.
   
   ---
   
   Do you think I can make a PR with the changes? 🙂


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


Re: [I] feat: As a user, I want to use "iss" JWT claim, so that I can verify my Apisix Consumers with a claim different than "key" [apisix]

Posted by "mikyll (via GitHub)" <gi...@apache.org>.
mikyll closed issue #11276: feat: As a user, I want to use "iss" JWT claim, so that I can verify my Apisix Consumers with a claim different than "key"
URL: https://github.com/apache/apisix/issues/11276


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