Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.
IDPBackend ProxyGithub

GitHub App authentication

Configure GitHub App authentication on an IDP Backend Proxy endpoint so plugins and Workflows call GitHub with an installation token

Use the githubApp authentication type on a Backend Proxy endpoint when you want Harness IDP to call the GitHub API with a GitHub App installation token. The proxy creates the token for you and injects it on every request, so plugins and Workflows do not need a personal access token in headers.

IDP applies auth.type: githubApp only when the endpoint is called through /v1/external-proxy/{endpoint}.


Before you begin

Make sure you have the following in place:

  • Configure Backend Proxies plugin: Enable Configure Backend Proxies plugin under IDP → Configure → Plugins. Go to Plugins overview for plugin enablement.

  • GitHub App installed: Create a GitHub App (or use an existing one), install it on the organization or account that owns the repositories you need, and note the App ID and installation ID.

  • Private key secret: Store the GitHub App private key in a Harness secret. Plain-text private keys in the proxy YAML are not supported.


Configure GitHub App authentication

To wire GitHub App authentication into a backend proxy endpoint, do the following:

  1. Go to the YAML editor available in the Configure Backend Proxies plugin.

  2. Click the Edit YAML button.

  3. Add an endpoint and set auth.type to githubApp.

    Map GITHUB_APP_PRIVATE_KEY to the Harness secret that holds the App private key in the plugin configuration variables, the same way you map other proxy secrets.

  4. Scroll down and click Save Configurations.


Configuration fields

Use the following fields under the endpoint auth block and target.

Field
Required
Description

target

Yes

Base URL of the GitHub API. Must use HTTPS.

auth.type

Yes

Must be set to githubApp.

auth.appId

Yes

GitHub App ID. Can be a literal string or a ${ENV_VAR} reference backed by a Harness secret.

auth.installationId

Yes

GitHub App installation ID. Can be a literal string or a ${ENV_VAR} reference backed by a Harness secret.

auth.privateKey

Yes

Must be a ${ENV_VAR} reference backed by a Harness secret.

Target URL formats

Set target to the GitHub API host, not the web UI host.

GitHub product
Target

GitHub.com

https://api.github.com

GitHub Enterprise Server

https://<ghe-host>/api/v3

Private key requirements

The proxy accepts the private key only through a Harness secret referenced as ${ENV_VAR}.

Secret type
Supported format

Secret Text

PEM private key

Secret File

Base64-encoded PEM private key


Authentication behavior

When a request reaches an endpoint that uses auth.type: githubApp through the external proxy API (/v1/external-proxy/{endpoint}), the Backend Proxy does the following:

  1. Generates a GitHub App installation token for the configured App ID and installation ID.

  2. Sets the outgoing request header to Authorization: Bearer ghs_*.

  3. Overrides any Authorization header that arrived on the incoming request.

Installation token, not App JWT

The authentication type produces an installation token. It does not produce a GitHub App JWT. Endpoints that require a JWT, such as /app and /app/installations, are not supported through this auth type.


Troubleshooting

401 Unauthorized

The target endpoint may require a GitHub App JWT. Installation-token auth cannot call JWT-only app endpoints such as /app and /app/installations.

403 Forbidden

The GitHub App installation may lack the permissions required for the API you called. Update the App permissions in GitHub, accept any permission updates on the installation, and retry.

404 Not Found

Confirm the path after your proxy endpoint maps to a real GitHub API resource, and confirm that the installation can access that organization, repository, or resource.


Next steps

Last updated

Was this helpful?