Adding custom session data to Dreamfactory JWT token
When working with Dreamfactory it might be desired and helpful to have additional claims (key/values) in the user session JWT token.
In my scenario I have custom API services / scripts which do calls to other services (DB, SOAP, external REST API). However not all calls work with only the email from the user session but rather require certain IDs not related to Dreamfactory at all. So the services would first have to fetch the Id by email resulting in additional API calls all the time causing slower response times.
So I was looking for a way to store those key/values. Read on after the jump how I solved it.