Data Sources, Json with dynamic bearer token

This article describes how authorization token might be setup. How to setup json datasource using Authorization Bearer token. Is there a way to setup a two part request? Firstly, sending a request to an endpoint to retrieve a Json Web Token (JWT) and then at the second step sending the actual request to get data from the api, using the Authorization header with Bearer schema? This would open up the usage of the Json data source to include alot of apis that use JWTs. And by allowing a handshake prior to the request it also allows that the contents of the data returned to be filtered by the current user permissions. This would of course need that the username and password can be overriden per user for a specific data source (I sent a separate topic for that).