> For the complete documentation index, see [llms.txt](https://knowledgebase.autorabit.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.autorabit.com/product-guides/codescan/codescan-integration/enterprise-git-connections/github-authentication-using-oauth-codescan.md).

# GitHub Authentication using GitHub Apps (CodeScan)

{% hint style="info" %}
**This integration has recently switched from using OAuth 2.0 to GitHub Apps.** &#x20;

If you are currently using the OAuth version of this integration, you do not have to change anything. AutoRABIT will continue to support all current projects of this type. However, all future connections must be made with the GitHub Apps flow below.
{% endhint %}

Connecting AutoRABIT (CodeScan) to GitHub Enterprise requires a secure handshake based on the GitHub Apps Framework.

**Applies To**

* GitHub Enterprise Server (self-managed) deployments; not applicable to [GitHub](https://www.github.com/).

**Generate Client ID and Client Secret**

1. Log in to your GitHub Enterprise Server with an admin account.
2. To create a GitHub App, copy the URL below.  \
   `https://your_ghes_hostname/settings/apps/new?name=codescan-enterprise-app&description=GitHub%20App%20for%20CodeScan%20integration&url=https://autorabit.com&callback_urls[]=https://YOUR_PUBLIC_BASE/_codescan/oauth2/authorize&request_oauth_on_install=true&public=true&contents=read&metadata=read&statuses=write&pull_requests=read&repository_hooks=write&setup_on_update=true&webhook_active=false`
3. Edit the URL by replacing the following placeholders:

   * `YOUR_GHES_HOSTNAME` → Your GitHub Enterprise Server URL\
     *(Example:* [*github.company.com*](http://github.company.com/)*)*
   * `YOUR_PUBLIC_BASE` → URL of the CodeScan instance\
     *(Example:* [*app.codescan.io*](https://app.codescan.io/)*)*

   <i class="fa-message-exclamation">:message-exclamation:</i>  NOTE: App name must remain exactly: **codescan-enterprise-app** (do not modify this).
4. Paste the URL into your browser.
5. Keep the app public by enabling **Any Account.**<br>

   <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2Fay5hvbMsAZKfLXkdhWTt%2Fimage.png?alt=media&amp;token=9d673c8d-81c3-4ca7-8ae3-bfa9caf3f673" alt=""><figcaption></figcaption></figure>
6. Click **Create GitHub App**
7. After creation, copy the App ID, Client ID and Client Secret, and use our [ALM Configuration Article](/product-guides/codescan/codescan-integration/enterprise-git-connections/configuring-and-managing-alm-integrations.md) to complete your setup.


---

# 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://knowledgebase.autorabit.com/product-guides/codescan/codescan-integration/enterprise-git-connections/github-authentication-using-oauth-codescan.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.
