> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ale.run/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub

> GitHub OAuth 연동 방법을 안내합니다.

> [card]
>
> GitHub OAuth를 등록하면 GitHub 계정 기반 로그인을 사용할 수 있고, 애플리케이션 플랫폼에서 GitHub 저장소를 연결해 서비스를 배포할 수 있습니다.

## GitHub Apps 생성

![](https://files.cloudtype.io/ale-docs/authentication/images/01_01.png)

> GitHub에 로그인 후, **Settings > Developer Settings > GitHub Apps** 페이지에서 [New GitHub App](https://github.com/settings/apps/new)을 클릭하면, GitHub App 생성 과정이 시작됩니다.

### 기본정보 입력

![](https://files.cloudtype.io/ale-docs/authentication/images/01_02.png)

> GitHub App을 생성하기 위한 정보를 아래와 같이 입력하세요.

* **GitHub App name** : GitHub App 이름
* **Homepage URL**
* GitHub OAuth를 적용할 홈페이지 URL
  * Ingress로 배포한 URL인 `https://app.[도메인]`
* **Callback URL(`Add Callback URL`로 항목 추가)**
  * `https://app.[도메인]/api/oauth/github/callback`
  * `https://app.[도메인]/api/oauth/github/connect/callback`

> [!NOTE]
>
> 이 화면에서 입력한 **GitHub App name**은 운영 시스템에서 GitHub OAuth 등록 시 사용됩니다.

> [!TIP]
>
> `https://app.[도메인]/api/`는 애플리케이션 플랫폼의 API 엔드포인트 주소입니다.

### Webhook 비활성화

![](https://files.cloudtype.io/ale-docs/authentication/images/01_03.png)

> Webhook 항목의 Active 체크를 해제하여 비활성화하세요.

### 권한 부여 및 APP 생성

![](https://files.cloudtype.io/ale-docs/authentication/images/01_04.png)

> Permission 항목에서 아래의 권한을 부여하고, `Create GitHub App` 버튼으로 APP을 생성하세요.

> [accordion] Repository permissions (9)
>
> * **Read and Write**
>   * Actions
>   * Administration
>   * Commit statuses
>   * Contents
>   * Deployments
>   * Issues
>   * Pull requests
>   * Workflows
> * **Read-only**
>   * Metadata

> [accordion] Organization permissions (2)
>
> * **Read and Write**
>   * Administration
> * **Read-only**
>   * Members

> [accordion] Account permissions (1)
>
> * **Read-only**
>   * Email addresses

## GitHub App 정보 조회

> 운영 시스템에 GitHub OAuth를 추가하기 위해 GitHub App Name 이외에 **4개의 ID, Key 값이 필요합니다.**

* **App ID**
* **Client ID**
* **Client Secret**
* **Private Key**

### App ID, Client ID 조회

![](https://files.cloudtype.io/ale-docs/authentication/images/01_05.png)

> 권한 부여 후 App이 생성되면, **App ID 와 Client ID**를 조회할 수 있습니다.

### Client Secret 조회

![](https://files.cloudtype.io/ale-docs/authentication/images/01_06.png)

> 같은 화면에서 `Generate a new client secret`을 클릭해 **Client Secret**을 생성하고 조회하세요.

### Private Key 조회

![](https://files.cloudtype.io/ale-docs/authentication/images/01_08.png)

> 화면 하단부의 `Generate a private key`를 클릭하면 PEM 파일이 다운로드됩니다.

## GitHub App 공개 설정

> 생성된 GitHub App의 공개 설정에 관한 기본값은 **비공개**이며, App을 생성한 계정이 속한 조직의 사용자만 GitHub App을 사용할 수 있게 됩니다. GitHub 조직과 상관없이 GitHub App을 사용할 수 있게 하려면 아래를 참고하세요.

> [accordion] GitHub App을 공개상태로 설정하기
>
> ![](https://files.cloudtype.io/ale-docs/authentication/images/01_16.png)
>
> 좌측의 **Advanced** 메뉴에서 **Danger Zone** 항목의 `Make public`을 클릭하세요.

## Ale AI 운영 시스템에 등록

![](https://files.cloudtype.io/ale-docs/operations/images/githuboauth01.png)

> `운영 시스템 > 설정 > 인증수단`의 GitHub 드롭다운을 클릭한 후, 앞 단계에서 조회한 값들을 각 필드에 입력하고 `적용하기`를 클릭하세요.

* **로그인 사용** : OAuth 로그인 적용 여부
* **APP\_NAME** : GitHub App 이름
* **APP\_ID** : App ID
* **CLIENT\_ID** : Client ID
* **CLIENT\_SECRET** : Client secret
* **APP\_PRIVATE\_KEY**: Private key PEM 파일 값

> [!NOTE]
>
> 적용 완료 후 대시보드에 접속하면 다음과 같이 **GitHub 계정으로 로그인** 버튼이 표시됩니다.
>
> ![](https://files.cloudtype.io/ale-docs/authentication/images/01_11.png)

## Github 계정으로 로그인

![](https://files.cloudtype.io/ale-docs/authentication/images/01_12.png)

> 사용자의 첫 번째 GitHub login 시, `Authorize [GitHub App 이름]`를 클릭하면 가입 신청이 진행되고, 관리자 승인 관련 메시지가 표시됩니다.

> [!NOTE]
>
> 가입 신청한 사용자의 승인(활성화)은 [사용자 등록 및 권한 관리](https://docs.ale.run/ko/enterprise/user-management.md)를 참고하세요.

> [!WARNING]
>
> 만약 브라우저에 로그인된 GitHub 계정이 GitHub App을 생성했던 계정과 동일하다면 위와 같은 창이 표시되지 않습니다.
> 새로운 브라우저 세션에서 GitHub App을 생성했던 계정이 아닌 다른 GitHub 계정으로 인증을 진행하세요.

> [!TIP]
>
> [GitHub APP을 비공개로 설정](https://docs.ale.run/ko/enterprise/github.md#github-app-%EA%B3%B5%EA%B0%9C-%EC%84%A4%EC%A0%95)한 경우, 로그인하려는 다른 계정이 GitHub App을 생성한 계정의 조직에 속해 있어야 GitHub 계정으로 로그인할 수 있습니다.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.