Not able to get value of parameter 'code' from url


I am trying to manually create an OAuth2 workflow for an app. After authorizing the app the server sends back an authorization code to the url as a value to a parameter called code.

Screenshot of URL below.

I am trying to get the value of code for subsequent API calls. To do this, I have a workflow created as follows:
When page loads;

  • set custom state
  • assign the value of “code” in the url to this state (using Get data from URL).

Screenshot below:

In the editor, to ensure the state is indeed getting the value of “code” I am printing it in a text box like below

But I do not know why, it just doesn’t get the value of code there. I have ensured there are no spelling errors or case mismatches .The URL has another parameter named state. I am able to get that value without any problems.

Can anybody help me with this please?

This is odd. I can’t see anything wrong and it should work. I have done a quick test here where it does work. Editor link.

Have you tried a) recreating the custom state; b) adding a small delay before setting the state and c) using the debugger tool to see what is being passed?

Failing these then it might be worth logging a bug report with Bubble Support.

Yeah, it works in a different app, but not in this one. I have run out of my wits currently :slight_smile:

So, the calback url doesn’t have a debug mode by default. Therefore, I edited the url added debug_mode=true and inspected the element. Below is the screenshot.

the state indeed gets assigned to the value of the code.

So the state is being set, just not being displayed?

Yeah that’s what it looks like.

Maybe your text element is too small so the text is hidden?

1 Like

I don’t believe it. yes that was the problem. The element was fixed width. It shows up now. Thank you!

This topic was automatically closed after 70 days. New replies are no longer allowed.