At a previous job, this is what we had done. We placed a customer id inside the token and retrieved it when it was decrypted during authentication (difference was this was a Node JS Type Script API). But, after poking around a little more, I found my answer in a payload option (reference #4). More specifically, you can place an object in the payload of the JWT token at creation and retrieve it in the controller.
The steps are:
- Call the authentication code that generates the JWT token.
- On your authentication code (TokenController.cs here), add an object to the payload.
- Inside your controller (ValuesController.cs here), consume the object
I believe I have found the solution I will be using for the TGIMBA API 🙂