Dynamic Authorization header not working

Hi !
I’m trying to send a bearer token dynamically in my workflow to an Api call using Bubble API Connector plugin. Here is how i am trying to achieve that :

Here is a screenshot of a step by step execution, the token seems to be correctly passed to the call :

But my server receive an empty value (almost empty, the start of the header "Bearer " is correctly send:
image

It works correctly specifying a token statically :
image
Header received on the server in that case :
image

Could someone give me a little help please :innocent: ?

What is the “Get cookies” step? How does the Cookies list get set?

After get cookies, it might need the remaining steps in another workflow, or a scheduled custom event, so it can pick up the changed cookies list.

1 Like

Hello @Mishav, thank’s for replying.
The Get Cookies step is an action provide by this plugin :

auth_token is written during the user login process.

Get Cookies step fills Cookies element’s Values property. I retrieve the auth_token value like this :
image

I am pretty sure this step works correctly, please refer to following screenshots :
I add a step to show the bearer token in an alert to verifiy if the step Get Cookies works correctly:

and the auth_token cookie’s value correctly show up in the alert.

Let me know if you need further informations, or if i am missing something.

Is it possible for the call api to take place before the cookie retrieval (which is linked to a page element) even if the call api step is after the cookie retrieval step?

1 Like

I think yes its likely, the workflow step is a backend one and has no direct dependency on the frontend step.

Did you try putting the backend step and following steps in a scheduled custom event?

1 Like

I didn’t !
And it works.
Thank you for helping me to understand how it works :slight_smile:
I finally created a custom state on the Cookies element which trigger the Auth Backend workflow when it becomes yes.

I switch it to yes after the Get Cookies step has been executed.


image

1 Like

I guess you didn’t know what I meant by custom event, you can read more about it in Bubble’s docs - schedule a custom event

@gael.monachon.dev it’s great you have a solution!