Connecting to External Services More Seamlessly

Hey everyone,

I am currently building a referral system for my application where I would like the ability for a user to import their google contacts. While the importing of google contacts is possible today via the API connector, there is a significant limitation, described below:

Let’s say a user is logged in to my app with their yahoo account but they want to import gmail contacts into their account. The way this is done with Bubble today is that the “Signup and Login with a Social Network” workflow needs to be called to authenticate the user. Doing this essentially replaces the user’s current logged in yahoo state and creates a new google account for the same user if it doesn’t already exist.

It would be great if Bubble had some type of workflow action that is a little different than signing up and logging the user with a social network: something to the extent of creating some type of oauth semi-logged in state in Bubble itself or a way to keep the current user’s logged in state so that external services can be connected to without new accounts being unnecessarily created. I’m sure this has extensions beyond google contact import.

Let me know what you guys think. Thanks,

-Jonathan Timianko

2 Likes

I didn’t realize that - haven’t gotten that far along in my app yet. What if they use the same email address across all platforms? Seems to me a single Bubble account would be used in that case. I wonder if there could be a way of “linking” a social media account to a Bubble account while the user is logged in?

If they use the same email address to authenticate with google as the one they used to login with Facebook then nothing will change since that account already exists. An example would be a user signed up with Facebook for the app originally and their Facebook email address is user1@gmail.com, then the user tries to upload their contacts and chooses user1@gmail.com as the google account they want to “link” to get the contacts. In this case the user’s logged in state would be maintained since that account already exists.

However, if they were logged in as user1@gmail.com and tried to fetch contacts from their user2@gmail.com account and bring them in to the app, the user1@gmail.com account that is currently logged in would be replaced with user2@gmail.com if it already exists or newly created if it doesn’t exist.

I like the terminology that you used regarding “linking” another account to a current logged in account so that information from that new account could be fetched and then brought in to the current already existing account. In my case it would be contacts from any email account that be brought in so that email referrals could be created, but I think this has an unbelievable amount of possible applications for many different applications and users.

In the meantime I am going to get creative and try to think of some workarounds and will post my progress on this thread as I proceed.

For logged in users, could you have an Import Google Contacts button which, when clicked, would allow them to authenticate with Google using any valid Google account they have? Then you could pull the contacts into their Bubble account. I’m no guru on the topic, but I think you can authenticate a user via a 3rd party without having to log them into Bubble using those same credentials.

Yes I agree with you and I’m kind of on that road, but I think the challenge that I’m trying to overcome is handling all of the authorization endpoints and token endpoints that allow authentication to happen without using the bubble api connector. The api connector is very good at allowing you to set up these endpoints so that it brings you to the page where you select the google account to authenticate with, but in order to call up that page you have to use the “Signup and Login with a Social Network Workflow”, and obviously what happens as a result of using that (logging the user in) is pretty much representative of the title of that workflow.

A potential workaround within Bubble is using some trickery with the workflows so that you sign up with google and then immediately revert the user to their previous logged in state and try to load the contacts onto the already-existing user’s account, but it sounds tough. Only other option really is to try and open a bunch of external websites and see if I can get the URL’s right.

Some related discussion has been had in the following two posts:

Hi All,

Just wanted to give a quick update to this thread and let everyone know that magically somehow at Bubble must have been listening because everything I describe above has been fixed! Thank you so much to whoever made some slight changes so that new accounts aren’t created!

If anyone has any questions on how all of this works feel free to personal message me at any time or post below!

-Jonathan Timianko

1 Like

Wow! :grinning: :+1:

As per the other thread, it now seems to log you into an account, if that account is already connected to bubble, when you connect another account to the SAME external login.

So you can’t connect two Bubble users to the same account ?

And you also don’t appear to be able to change the OAUTHed account either.

Yep that’s right, here’s the other thread happening in case anyone wants to track: How do I implement an OAuth2 flow in my UI?