Service Based JWT Token

Hello,

Currently I am working with a project that requires individual JWT authentication for each service through the Kong gateway. However, through testing it seems like this functionality is not possible, below is the scenario that I have:

Consumer A [JWT Plugin enabled]
—ServiceA [JWT Plugin enabled for all consumers]
— Route A [JWT Plugin enabled for all consumers]

In the scenario above, the JWT works as intended. If I go to the service UI without the JWT token, I get a 401. However if I go to the service UI with the JWT token, then I get a 200 OK.

The issue I have is the next scenario in which each service needs an individual token. I use the consumer ID to link the consumers to the respective services like in the below scenario:

Consumer A [JWT Plugin enabled]
—ServiceA [JWT Plugin enabled for consumer A]
— Route A [JWT Plugin enabled for consumer A]

In this second scenario, the JWT no longer works as intended. If I go to the service UI without the token, it gives me a 200. Is this functionality possible with the JWT plugin? If so, what is the best way to go about it?


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ