# 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 App for CodeScan integration&url=https://autorabit.com&callback_urls[]=https://YOUR_PUBLIC_BASE/_codescan/oauth2/authorize&request_oauth_on_install=true&public=true&contents=read&metadata=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="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2Fay5hvbMsAZKfLXkdhWTt%2Fimage.png?alt=media&#x26;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](https://knowledgebase.autorabit.com/product-guides/codescan/getting-started/using-codescan/adding-projects-to-codescan/enterprise-git-connections/configuring-and-managing-alm-integrations) to complete your setup.
