How to send dynamic header values with the API

Hi everyone.

I am currently building a login flow that integrates Bubble, Auth0 and Xano.

Here is an outline of the flow I would like:

User clicks the login button on the Bubble login page


Auth0 handles the authentication


Auth0 redirects the user to Bubble (profile registration page) with a code and state parameters in the URL

I need to send that code (dynamically) to Xano’s /auth0/continue endpoint

In return I receive a token and user information

The problem I am facing is:
I need to include the code as a dynamic value in my API call, either as a parameter or as an Authorization header, but Bubble’s API connector doesn’t seem to allow me to inject dynamic data directly into the header.

Question:
Is there a standard way to send dynamic headers or query parameters (e.g. code) from Bubble to Xano?

Is there a best practice for integrating Auth0 → Bubble → Xano for this type of login flow?

Any help would be appreciated. I’d be happy to share a screenshot of my current workflow setup if needed.

Bubble allow you yo send dynamic parameters in header if private checkbox is unchecked. You need to initialize your call first.

Thank you. I don’t understand “initialize your call first.” How should I change the continue API settings? I got the code value from the URL of the page redirected after logging in and set it manually. You can only call once using the code, and a token is returned at that time. I would appreciate your advice.

In your screenshot, you can see that you didn’t initialize your call (in red). You will need to get a valid code and paste it (really fast) to api connector and initialize your call. Once it’s done, you will be able to use it in workflows and populate this dynamically using Get data from url.

Thank you.
That’s it.

Sorry, please help me a bit more.

But when I add this continue API to the workflow, an error message appears for some reason.
Do you know the cause of this?
I can share screenshots if necessary, so please let me know.

The other “initAPI” issues an Auth0 login URL (authUrl).
This is opened by “Open an external website”.

Next, once the login is complete, redirect to the following URL:

Redirect destination: https://xxxxxx.com/api/1.1/oauth_redirect?code=XXXXXX

The “code” is returned as a URL parameter, so retrieve it here and then execute “Continue API”.

Next, I want to use the token obtained from the Continue API to transition to the register page (user profile registration page).

■Problem

However, when I click the login button, a ContinueAPI error occurs.
As you can see in the screenshot above, initialization has been completed.

I would be grateful if you could tell me how to solve this problem.

■Addendum

After running this flow, I looked at the work again and it said,

This call has been modified since you last initialized; consider reinitializing.

What should I do?

You have a wrong authrozation when you get the code. Use step by step to check what you get and send to api.

Thank you.

Sorry, I’ve tried various things but I still don’t understand.

Is it possible that in STEP 3 the code obtained from the URL is not being sent to the API?

Could be two thing. A) You are not getting the code from the page url.
From what I see, this may be possible as you try to use open an external website that is probably the authorize url and after in the same workflow, you are trying to fetch the token.

You should remove all step after open an externa website (that is probably returning an error in issue checker anyway because this should be the last step in a workflow) and instead add a workflow on page load (when get code from page url is not empty) and process to the continue step.

Thank you.
I feel like I’m almost there.

I tried separating the workflows. What do you think?

However, as it is now, the page is loaded on the login page (https://xxxxxxxx.com/login), so it seems that the continue API cannot be called.

Currently, when the Auth0 login is completed, it redirects to the following:
https://xxxxxx.com/api/1.1/oauth_redirect?code=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

What should I do in this case?

I would appreciate your advice.

Thank you for your continued support.

You cannot use the generic redirect url if you want to manually manage the auth process. The generic url is only used if you select the Bubble user-agent auth. You are using self-handled. You could try to use a backend WF API endpoint with redirect to a page after or just set a page of your app that will contain the continue part (can be the same page that you have the authorize link (with conditionnal that detect the code in url, you could hide button to authorize page and show a loading icon)