How to change a redirect URL in the API Connector plugin

There’s a checkbox field in the API Connector plugin that says “Use a generic redirect URL (https://[my-domain]/api/1.1/oauth_redirect)”. I want to NOT use this hard-coded redirect URL and instead define my own redirect URL, but when I uncheck the checkbox, no field appears for me to enter in my own URL. Does anybody know how I can change the bubble-provided redirect URL to my own?

Hello! The redirect URI is generally set on the dashboard of your API account. The generic redirect URI checkbox that we provide allows you to set a generic URL that will automatically recognize whichever page of your app you are coming from when the API call is made, and redirect you to that specific page. This allows you to have a login button on multiple different pages without having to add multiple redirect URIs to your API account’s dashboard (with some APIs, you can only add one URL).

If you don’t want to use the generic redirect URI, there is no additional step on Bubble - you would enter the exact URL of the specific page in your app that contains the login button on your API provider’s dashboard.

I hope this helps!

Hi Sam-- thanks for your response. I’m trying to follow your instructions to test my own custom redirect URL, but unticking the box “Use a generic redirect URL” (as screenshotted in the original post) seems to always trigger a 400 error. Here’s an example:

In this case, I’m using Google OAuth, and I’ve already defined my custom authorized redirect URI in the Google Developer Console (the API dashboard.) (I’m using youtube.com for this example.) Expected behavior: I trigger a workflow in my bubble app that kicks off this API call, then after logging in, I’ll be pushed to youtube.com. Actual behavior: I trigger the workflow to kick off the API call, and I immediately see the 400 error. Note that this 400 error also appears even if I make the Authorized redirect URI in my Google Developer Console the generic redirect URL provided by bubble, which in this case is https://returnfairy.co/api/1.1/oauth_redirect.

Thoughts?

Hello!

The redirect URI must match exactly the URL from which the initial workflow was triggered.

For example, if I place a login button on https://myappname.bubbleapps.io/version-test/myloginpage if my redirect URI is anything other than that exact URL, it would be expected that you would receive a 400 error.

The redirect URI is a way for a third party API to verify where you came from and where you should return to. Any additional redirects must happen from within your app.

To redirect the user to a different URL than they started from, you’ll want to set up a page is loaded workflow on your initial log in page that looks at some parameter or value that signified that the API authorization has been successful, and then redirects them to a different site from there.

I hope this all makes sense. In the above example and screenshot, google is recognizing where you came from, and expecting your redirect URI to be https://returnfairy.co/version-test/sign_in?debug_mode=true

Hi Sam,
Do you confirm that this only the case when you do not use the generic redirect URL.
I am struggling with the Agent OAUth2 flow since days, and get
{“statusCode”:400,“body”:{“status”:“ERROR”,“message”:“Redirect ID invalid”}}
when Pipedrives redirects me to the app.
My WF starts with the index page with a WF on page load opening: Log in

Hello Sam,

I am struggling with a similar issue. I use fb ads to aquire new users for my web app. However, if fb click id is being appended to my index url whenever a user clicks on the fb ad (e.g. www.myapp.com/?fbclid=IwAR0aDCZf9…). This long id screws up my Google auth process which is triggered from a popup on the index page.

How can I get rid of this appended id OR redirect to the nominal index url?

Thanks a lot in advance!