Form Flows: Can't set a dynamic http connection token

Hi everyone,

I’m trying to implement a form that calls after user input some API via a flow. I would perform this call with a HTTP Connection within the flow then.

But when setting up HTTP Connections, I need to configure a Bearer Token globally at the connection level once. This seems confusing, as tokens don’t have an unlimited lifetime and so they certainly get invalidated at some point for this connection.

I though that I could just define the token in the HTTP call itself by setting an Authorization header that overwrites the token originally defined for the connection but that doesn’t seem to work.

My workaround was now to stop the flow before the call and instead have another action in the trigger after this action finished which does a standard fetch-call. Not as convenient but so I can set the Authorization header how I need it (e.g. generating a M2M token on the fly and then calling our API with it).

Do I get something wrong here? Or what is the supposed use case of the HTTP connection within flows?

Hi @winkler

Welcome to the Auth0 Community!

I will be looking into your inquiry and come back as soon as possible with an update regarding the matter!

Kind Regards,
Nik

Hi again!

Regarding the issue that you are having with the HTTP request flow, indeed, whenever you need to make an API call using a bearer token header which unfortunately expires, you cannot dynamically update the value directly without using a shared or context variable.

In order for the flow to run correctly, I would recommend making an API call in the flow first which will fetch the API token and then use that token in the HTTP request to your API. This way, you should be able to use the result of the first API call ( the api token) and declare it as a variable inside the second HTTP flow.

You can check out our documentation on variables and helper function within the Auth0 Forms and Flows.

If you have any other questions, let me know!

Kind Regards,
Nik