-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JWT requires unique key across all consumers? #1512
Comments
postgres too. I have the same question. |
A Consumer in Kong is an abstract concept, not necessarily an individual. Why not creating a Consumer that is, in fact, your application? |
Considering this answered since no reply was given. Feel free to re-open of open another issue if you have any other concern. |
I have the same issue, where I want grant access individuals to use a protected endpoints, at the same time I need to verify the jwt token on another services. |
I have the same issue. Using the same consumer for all of my users isn't acceptable since it eliminates or severely hampers the usefulness of most of Kong's middleware. How do I rate limit a single user? |
@thibaultcha any chance of getting this one re-opened? I've got the same issue, I'm using keycloak as the JWT provider. As per @codeocelot I want to use kong's consumer for rate limiting, analaytics and other plugins. Having a single consumer in kong for all apps that use my APIs won't work. Is there a reason for the unique constraint? |
I was able to satisfy my use case by changing to configuration of the plugin. clientId as the config.key_claim_name instead of iss. |
Git history doesn't show a defined reason to hold this constraint (it has been present since the initial commit). Need to look into why this was assigned, particularly with acknowledgement to cb9bac0 which references this nature specifically. |
@thetrav Could you please describe it in more detail?
|
I was following some guide which used the issuer of the token as the "key_claim_name", which in this case was always the same value (keycloak, my token provider) which provides keys to multiple different consumers. Kong uses key_claim_name to map the token to its consumer, so using the clientId claim makes a lot more sense than using the issuer (iss) I'm actually using Keycloak as the provider for an OpenID Connect solution. I looked at the Kong plugin for OIDC, however it wanted to be the token provider. |
#2548 removes the unique constraint on JWT credentials, so this should be resolved. Expect this for a 0.11 release. Thanks! |
hi, which causes the following error :
when using jwt rs256 and trying to configure the same jwt issuer for different consumers. Anyhow, as per @thetrav 's comment: in the case of auth0, the more generally, unicity constraint could be defined on a composite key, in case of auth0 this would be |
It is currently not possible to remove the unique constraint on |
Summary
I've been working to integrate Auth0 with Kong, and have most everything working, but only for a single user. As far as I can tell, Auth0 uses a single key and secret per application to sign all tokens, and there isn't a way to change that.
Kong appears to expect both of these values to be unique across all consumers. So, when I try to set up a second consumer's JWT, I get a 409 response back.
The ask would be to relax the uniqueness constraints on the key and secret.
Steps To Reproduce
Additional Details & Logs
$ kong version
)0.8.3
JWT plugin
<KONG_PREFIX>/logs/error.log
)Credential creation returned an unknown error. Status: 409, Body: { "secret": "already exists with value '0nyB_F6XMrNc09maS6qe-DSD73o_AbD9hCq9649SkcNH0VhiImjdOLx4FoWjnB8x'" }
Cassandra
The text was updated successfully, but these errors were encountered: