Heroku Connection
Learn how to configure a Heroku Connection for Hanzo KMS using OAuth or Auth Token methods.
Hanzo KMS supports two methods for connecting to Heroku: OAuth and Auth Token. Choose the method that best fits your setup and security requirements.
The OAuth method provides secure authentication through Heroku's OAuth flow.
Using the Heroku Connection with OAuth on a self-hosted instance of Hanzo KMS requires configuring an API client in Heroku and registering your instance with it.
Prerequisites:
- A Heroku account with existing applications
- Self-hosted Hanzo KMS instance
Navigate to your user Account settings > Applications to create a new API client.

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.
The domain you defined in the OAuth callback URL should be equivalent to the SITE_URL configured in your Hanzo KMS instance.

Obtain the Client ID and Client Secret for your Heroku API client.

Back in your Hanzo KMS 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 Hanzo KMS instance and use the Heroku Connection.
Setup Heroku OAuth Connection in Hanzo KMS
Navigate to the Integrations tab in the desired project, then select App Connections.

Select the Heroku Connection option from the connection options modal.

Select the OAuth method and click Connect to Heroku.

You will be redirected to Heroku to grant Hanzo KMS access to your Heroku account. Once granted, you will be redirected back to Hanzo KMS's App Connections page.

Your Heroku Connection is now available for use.

The Auth Token method uses a Heroku API token for authentication, providing a straightforward setup process.
Setup Heroku Auth Token Connection in Hanzo KMS
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.
Keep your Authorization token secure and do not share it. Anyone with access to this token can manage your Heroku applications.

Navigate to the Integrations tab in the desired project, then select App Connections.

Select the Heroku Connection option from the connection options modal.

Select the Auth Token method and paste your Heroku Authorization token in the provided field.

Click Connect to establish the connection.
Your Heroku Connection is now available for use.

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.
How is this guide?
Last updated on