> ## Documentation Index
> Fetch the complete documentation index at: https://infisical.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Heroku connection

> Learn how to configure a Heroku Connection for Infisical using OAuth or Auth Token methods.

Infisical supports two methods for connecting to Heroku: **OAuth** and **Auth Token**. Choose the method that best fits your setup and security requirements.

> [tab] OAuth Method
>
> The OAuth method provides secure authentication through Heroku's OAuth flow.
>
> > [accordion] Self-Hosted Instance Setup
> >
> > Using the Heroku Connection with OAuth on a self-hosted instance of Infisical requires configuring an API client in Heroku and registering your instance with it.
> >
> > **Prerequisites:**
> >
> > * A Heroku account with existing applications
> > * Self-hosted Infisical instance
> >
> > **1. Create an API client in Heroku**
> >
> > Navigate to your user Account settings > Applications to create a new API client.
> >
> > ![Heroku config settings](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/integrations/heroku/integrations-heroku-config-settings.png)
> >
> > ![Heroku config applications](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/integrations/heroku/integrations-heroku-config-applications.png)
> >
> > ![Heroku config new app](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/integrations/heroku/integrations-heroku-config-new-app.png)
> >
> > Create the API client. As part of the form, set the **OAuth callback URL** to `https://your-domain.com/organization/app-connections/heroku/oauth/callback`.
> >
> > > [!TIP]
> > >
> > > The domain you defined in the OAuth callback URL should be equivalent to the `SITE_URL` configured in your Infisical instance.
> >
> > ![Heroku config new app form](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/integrations/heroku/integrations-heroku-config-new-app-form.png)
> >
> > **2. Add your Heroku API client credentials to Infisical**
> >
> > Obtain the **Client ID** and **Client Secret** for your Heroku API client.
> >
> > ![Heroku config credentials](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/integrations/heroku/integrations-heroku-config-credentials.png)
> >
> > Back in your Infisical instance, add two new environment variables for the credentials of your Heroku API client:
> >
> > * `INF_APP_CONNECTION_HEROKU_OAUTH_CLIENT_ID`: The **Client ID** of your Heroku API client.
> > * `INF_APP_CONNECTION_HEROKU_OAUTH_CLIENT_SECRET`: The **Client Secret** of your Heroku API client.
> >
> > Once added, restart your Infisical instance and use the Heroku Connection.
>
> ## Setup Heroku OAuth connection in Infisical
>
> **1. Navigate to App Connections**
>
> Navigate to the **Integrations** tab in the desired project, then select **App Connections**.
>
> ![App Connections Tab](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/app-connections/general/add-connection.png)
>
> **2. Add Connection**
>
> Select the **Heroku Connection** option from the connection options modal.
>
> ![Select Heroku Connection](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/app-connections/heroku/heroku-select-connection.png)
>
> **3. Choose OAuth Method**
>
> Select the **OAuth** method and click **Connect to Heroku**.
>
> ![Connect via Heroku OAuth](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/app-connections/heroku/heroku-create-oauth-method.png)
>
> **4. Grant Access**
>
> You will be redirected to Heroku to grant Infisical access to your Heroku account. Once granted, you will be redirected back to Infisical's App Connections page.
>
> ![Heroku Authorization](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/integrations/heroku/integrations-heroku-auth.png)
>
> **5. Connection Created**
>
> Your **Heroku Connection** is now available for use.
>
> ![Heroku OAuth Connection](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/app-connections/heroku/heroku-connection.png)

> [tab] Auth Token Method
>
> The Auth Token method uses a Heroku API token for authentication, providing a straightforward setup process.
>
> ## Setup Heroku auth token connection in Infisical
>
> **1. Generate Heroku API Token**
>
> Log in to your Heroku account and navigate to Account Settings.
>
> Under the **Authorizations** section on the **Applications** tab, reveal and copy your Authorization token. If you don't have one, click **Create Authorization** to create a new token.
>
> > [!WARNING]
> >
> > Keep your Authorization token secure and do not share it. Anyone with access to this token can manage your Heroku applications.
>
> ![Heroku API Token](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/app-connections/heroku/heroku-api-token.png)
>
> **2. Navigate to App Connections**
>
> Navigate to the **Integrations** tab in the desired project, then select **App Connections**.
>
> ![App Connections Tab](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/app-connections/general/add-connection.png)
>
> **3. Add Connection**
>
> Select the **Heroku Connection** option from the connection options modal.
>
> ![Select Heroku Connection](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/app-connections/heroku/heroku-select-connection.png)
>
> **4. Configure Auth Token**
>
> Select the **Auth Token** method and paste your Heroku Authorization token in the provided field.
>
> ![Configure Auth Token](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/app-connections/heroku/heroku-create-token-method.png)
>
> Click **Connect** to establish the connection.
>
> **5. Connection Created**
>
> Your **Heroku Connection** is now available for use.
>
> ![Heroku Auth Token Connection](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/app-connections/heroku/heroku-connection.png)
>
> > [!NOTE]
> >
> > Auth Token connections require manual token rotation when your Heroku Authorization expires or is regenerated. Monitor your connection status and update the token as needed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.