BUBBLE SETUP DOCS
Multiple Connection Auth
9min
pathfix allows you to add multiple connections against a single user e g 2 twitter accounts or add 3 gmail accounts etc for bubble users, pathfix will render the auth ui and manage the connections for these multiple accounts the process to make request in bubble is slightly more complex but this documentation will walk you through the process please note for bubble multi connection auth, there is a new user concept called virtual user id virtual user id's help associate each connected account for the user in case of multi accounts pathfix setup once you have registered your application with the provider you wish to integrate with login to your pathfix account and click on add application add the name of your web app and hit save select the provider you want to offer the integration from the list of providers you can change the display name and description in the general tab enter the client id and client secret received from provider and hit save copy your pathfix public key and private key for use in the plugin bubble setup ui setup the bubble auth ui is handled by pathfix through our pathfix oauth connector plugin install the pathfix oauth plugin if you already have the plugin installed, make sure you are on version 2 4 1 or above add your pathfix public key under the public key section under x partner key , add your pathfix public key and private key separate by a dot ( public private ) if you do not have a pathfix account, enter the x partner key provided by the plugin in bubble preview mode add the pathfix connector element to your page and select all providers configured in my pathfix account enable multiple connections per user you will now see the the provider auth button listed with the ability for your users to connect multiple accounts make request for every user that connects multiple accounts for a single provider, pathfix assigns a virtual user id this virtal user id needs to be used across all your api calls, including workflow setup to get the virtual user id, you will need to setup the following workflow in bubble on the page where you want to call the api, you need to do the following steps get the list of connection names that have been authorized by the user pick a connection from the list for which you want to retrieve the virtual user id store the virtual user id to replace the user id parameter in all your api calls 1 to get the list of connection names for the page where you want to to invoke the api, go to workflow on page load select get user connection names this will insert the list of connection names in a bubble state 2\ pick a connection from the list for which you want to retrieve the virtual user id you can offer your user to select from their multiple connections anywhere on your app below is a sample configuration for a dropdown when the user makes a selection, you will need to setup a new workflow select when dropdown's value is changed setup step 1 to query connection property as shown below 3\ store the virtual user id to replace the user id parameter in all your api calls add another workflow do when condition is true and choose the pathfix connector's requested connection property is not empty this will generate the virtual user id that you can save to your database or use however you want