> 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\
     \&#xNAN;*(Example:* [*github.company.com*](http://github.company.com/)*)*
   * `YOUR_PUBLIC_BASE` → URL of the CodeScan instance\
     \&#xNAN;*(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="/files/HKYhhqQKYP8STeCu68sa" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://knowledgebase.autorabit.com/product-guides/codescan/codescan-integration/enterprise-git-connections/github-authentication-using-oauth-codescan.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
