FreshBooks signs users in with their FreshBooks account, for integrations built around invoicing and time tracking.

## Copy the redirect URI

In the [Authdog console](https://console.authdog.com), select the project and environment, open **Authentication > Providers**, find **FreshBooks**, and click **Enable**. Copy the redirect URI shown in the form:

```url
https://identity.authdog.com/api/v1/callback/<connectionId>
```

## Create the application

1. Open the [FreshBooks Developer portal](https://my.freshbooks.com/#/developer) and create an app.
2. Fill in the name and description.
3. Under **Redirect URI**, paste the redirect URI from Authdog.
4. Save, then copy the **Client ID** and **Client Secret**.

## Configure Authdog

| Field | Value |
| --- | --- |
| **Client ID** | The client identifier from the provider |
| **Client Secret** | The client secret from the provider |

Save, then toggle the connection **active**.

## What FreshBooks returns

Authdog requests the `user:profile` scope and reads the profile from `https://api.freshbooks.com/auth/api/v1/users/me`.

The users endpoint returns the user id, email, name, and the businesses the account belongs to.

A FreshBooks identity can span several businesses. Resolve which one the session applies to in your own product.

## Test it

1. Open your environment's hosted sign-in page, or link to `https://identity.authdog.com/api/v1/signin/<connectionId>`.
2. Select the FreshBooks button and complete the flow.
3. Confirm the user appears under **Users** in the console with a FreshBooks identity linked.

## Troubleshooting

| Symptom | Cause |
| --- | --- |
| `invalid_client` | Client ID or secret mismatch |
| Redirect or callback URL error | The URI registered with the provider does not match Authdog's exactly |
| Works in one environment only | Each environment has its own `connectionId`, and so its own redirect URI to register |

## Related

| Read | To learn how to |
| --- | --- |
| [Connectors](/docs/connectors) | Set up any other social provider |
