Connect your users via the auth flow
Enable your users to securely connect their QuickBooks Desktop to your application.
The authentication flow in Conductor is a user interface walkthrough that allows your users to securely connect their QuickBooks Desktop installation to their Conductor account. For an example, check out this demo of the auth flow.
There are two main approaches to integrating the auth flow with your application:
- 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.
Create an EndUser
Consider you have an end-user of your application who needs to connect their QuickBooks Desktop to your application. Begin by creating an EndUser 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.
If your database has a users
table, consider creating a column called conductor_end_user_id
.
Check if the EndUser has an active QuickBooks Desktop connection
The next step is to initiate an AuthSession 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 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:
Create an EndUser
If you haven’t already done so, create an EndUser and save their id
. You will use this id
to authenticate future requests.
Create an AuthSession
Using the EndUser ID, create an AuthSession with an extended link expiry time if needed:
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: