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.

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:
Go to the YAML editor available in the Configure Backend Proxies plugin.
Click the Edit YAML button.
Add an endpoint and set
auth.typetogithubApp.Map
GITHUB_APP_PRIVATE_KEYto the Harness secret that holds the App private key in the plugin configuration variables, the same way you map other proxy secrets.Scroll down and click Save Configurations.
Configuration fields
Use the following fields under the endpoint auth block and target.
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.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 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:
Generates a GitHub App installation token for the configured App ID and installation ID.
Sets the outgoing request header to
Authorization: Bearer ghs_*.Overrides any
Authorizationheader that arrived on the incoming request.
Troubleshooting
Next steps
Architecture of IDP Plugins: How Backend Proxy and Delegate Proxy fit together.
GitHub Raw Files: Call raw files from GitHub with a personal access token in proxy headers.
Custom Plugins V2: Call a configured proxy endpoint from a custom plugin with
PluginAPI.proxyFetch().
Last updated
Was this helpful?