- Integrate the auth flow with your backend to manage multiple users and connections.
- Generate shareable auth links for getting started quickly or one-off connections.
Integrate the auth flow with your backend
If you are building a multi-user service where each user needs to connect their QuickBooks Desktop account to your application, you’ll want to integrate Conductor’s QuickBooks Desktop auth flow into your backend.1
Create an end-user
Consider you have an end-user of your application who needs to connect their QuickBooks Desktop to your application. Begin by creating an end-user for that user and saving their
id to your database. You will use this id to match your users to their corresponding QuickBooks Desktop connection in Conductor.2
Check if the end-user has an active QuickBooks Desktop connection
The next step is to initiate an auth session for your user to connect their QuickBooks Desktop. However, what if they already has an active connection? Or, what if they previously started the auth flow but didn’t complete it?Imagine your application has a web app where your users configure the integrations with their application. If you create a section for the QuickBooks Desktop integration, you can use the following approach to track whether an active connection already exists:Note: Replace
You must send any request and check the
error.code to determine the
appropriate action. The key distinction in error handling is:INTEGRATION_CONNECTION_NOT_SET_UP: The user needs to complete the auth flow.- Other connection errors: The user needs to take a specific action (like restarting QuickBooks) but does not need the auth flow.
updateUI() with your actual code that updates your application’s UI based on the status or errors received.Create a shareable auth flow link
For a quick start, particularly useful for pilot deployments or small-scale operations, generate a secure, shareable link for the QuickBooks Desktop auth flow:1
Create an end-user
If you haven’t already done so, create an end-user and save their
id. You will use this id to authenticate future requests.2
Create an auth session
Using the end-user’s ID, create an auth session with an extended link expiry time if needed:
3
Share the auth flow link
Share the generated
authFlowUrl with your end-user to direct them to the auth flow to connect their QuickBooks Desktop instance to your application.The link will resemble this mock example:Embedding the auth flow in an iframe
Conductor supports embedding the auth flow in an iframe to present it as an in-page modal instead of opening it in a new tab or popup. The auth flow pages do not sendX-Frame-Options or Content-Security-Policy headers that block framing.
If the iframe does not load or work correctly, check the following:
- If your app sets a
Content-Security-Policywith aframe-src(orchild-src) directive, addhttps://connect.conductor.isto it. Otherwise, the browser refuses to load the iframe with a CSP console error that can make it appear as though the auth flow is blocking the embed. - If you use the iframe
sandboxattribute, include at leastallow-scripts allow-same-origin allow-downloads; the auth flow includes a step where the user downloads a config file, which fails silently in a sandboxed iframe withoutallow-downloads. Addallow-popupsif you want the flow’s outbound links to open.

