> For the complete documentation index, see [llms.txt](https://docs.aviator.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aviator.co/manage/on-premise-installation/github-oauth-for-on-prem.md).

# GitHub OAuth for On-Prem

Learn about using GitHub OAuth connection in Aviator and its configuration. GitHub OAuth maps a GitHub username to an Aviator user within a single installation.

There are two types of GitHub connections that Aviator uses:

* GitHub app - this ensures that Aviator can connect with the GitHub repos and take action on the pull requests. This is typically done as part of initial setup, and there is one shared connection across the entire GitHub organization.
* GitHub OAuth - this is used to map a GitHub username to an Aviator user within a single installation. Every engineer in the team is expected to make this OAuth connection to enable certain features in Aviator. For instance, with this a user can then access their [<mark style="color:blue;">Inbox</mark>](https://docs.aviator.co/inbox), or get [<mark style="color:blue;">personal Slack DMs</mark>](https://docs.aviator.co/mergequeue/how-to-guides/custom-integrations/personal-integrations#personal-slack-notifications).

## On-premise setup

You would typically [<mark style="color:blue;">set up a new GitHub app</mark>](https://docs.aviator.co/manage/on-premise-installation/github-app-for-on-prem) when installing Aviator on-premise. But GitHub OAuth connection is optional.

GitHub OAuth connection can be configured once the GitHub app is set up. To configure the GitHub OAuth connection:

**Step 1**

In the Github app settings, change the Callback URL to: **Callback URL:** `https://$AV_HOSTNAME/login/oauth/callback/github`

**Step 2**

Set the env variables for `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET` for the Aviator server (both web and worker). Depending on your installation choice, the env variables may be set in different ways.

* `$GITHUB_CLIENT_ID`: Client ID of the GitHub app, you can find this in the General settings of the GitHub app.
* `$GITHUB_CLIENT_SECRET`: Client Secret of the GitHub app, you can generate a client secret in the General settings for the Github app.

**Step 3**

Restart the server.

Now if you navigate to `/inbox` you should be able to complete a GitHub OAuth workflow.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aviator.co/manage/on-premise-installation/github-oauth-for-on-prem.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
