Add server response as payload to access token

With Auth0, is it possible to add a response from a webserver as a payload to the access token?

Context: A user logs into our web app (or mobile app) and gets an access token from Auth0. With the access token in the authorization header, the web app then makes a request to our backend to get a “Twilio Auth Token”. The Twilio Auth Token(*) is a special token that contains information about the Twilio client and the logged in user.

(*) https://support.twilio.com/hc/en-us/articles/223136027-Auth-Tokens-and-how-to-change-them

Instead of having our web app asking our backend to get the Twilio Auth Token, is it possible that we configure a rule (or something else) in Auth0 that fetches the Twilio Auth Token from our backend (via a GET request and the OAuth access token from Auth0) and then add the Twilio Auth Token as a payload to the access token?

By doing so, we save our web apps and mobile apps from fetching and also refreshing the Twilio Auth Token if it would be already part of the access token created by Auth0.

Is this use case implementable with Auth0?

Best wishes,
Lars

As it has been more than a few months since this topic was opened, and there has been no reply or further information provided as to the existence of the issue, we are closing this topic. Please don’t hesitate to create a new topic if this issue is still present, we would be happy to work with you to help find a resolution.