today I started looking at Kong and how it provides some functionalities through plugins. I was reading the [enter link description here][Plugins] page and started looking at the JWT.
It seems that Kong offers these endpoints (and not only):
- Create a Consumer;
- Create/Delete a JWT credential;
- Generate a JWT token with credential taken from step 2;
Once active, Kong will verify the validity of the JWT (and claims) and forward to the APIs endpoint the request if it's valid.
Here are my questions:
Since JWT is used also to carry info (e.g. customer ID, customer role) in order to have always a subset of the user info in every API without querying every time the DB or other endpoints, how can each API parse the JWT token and extract the info in it?
Imagine I want to create a single page application that interact with Kong that hides many microservice. Which is the best way to use JWT that each backend microservice can parse the JWT token in order to retrieve for instance the user ID that made the request?
Does kong offer an api to parse the JWT token?