> 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/arm-1/arm-features/version-control/introduction-to-version-control/configure-gitlab-oauth-for-repository-registration-in-arm.md).

# Configure GitLab OAuth for Repository Registration in ARM

### Overview

ARM supports **OAuth authentication for GitLab repositories** as an alternative to Personal Access Token (PAT) and SSH authentication.

This article explains how to create a GitLab OAuth application, authorize ARM, and register a GitLab repository using OAuth.

### Prerequisites

Before you begin, ensure that:

* You have access to the GitLab repository.
* You have permission to create an OAuth application in GitLab.
* You have permission to register repositories in ARM.

### Configure GitLab OAuth

#### Step 1: Start Repository Registration in ARM

1. Log in to **ARM**.
2. Navigate to **Settings → Repositories**.
3. Click **Register repository**.
4. Select:
   * **Version control system:** GIT
   * **Git provider:** GitLab
   * **Access type:** OAuth

The OAuth configuration fields are displayed.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2F6mCfKTbiQRqdfwrNPqE9%2FA3C87E72-FF16-4A25-9828-009FABF1E5A6.png?alt=media&amp;token=42e5864d-3506-460c-8221-c0461de14302" alt=""><figcaption></figcaption></figure>

#### Step 2: Copy the Callback URL

ARM automatically generates a **Callback URL**.

Click the **Copy** icon next to the Callback URL.

Example:

`https://<your-arm-instance>/api/git-oauth/callback`

This URL is required when creating the OAuth application in GitLab.

#### Step 3: Create an OAuth Application in GitLab

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FofrsHpUseyegIU7rZMdD%2FD48DCBF8-ED47-4623-8B06-FDEB68B187CA.png?alt=media&amp;token=d03f8a68-3527-4488-b193-3c6062954a8b" alt=""><figcaption></figcaption></figure>

Log in to GitLab and navigate to:

**User Settings → Access → Applications**

1. Under **Your applications**, click **Add new application**.
2. Enter an application **Name**.
3. Paste the ARM **Callback URL** into the **Redirect URI** field.
4. Keep **Confidential** enabled.
5. Under **Scopes**, select the following **mandatory scopes**:
   * **api** – Provides API access required for GitLab integration.
   * **read\_user** – Allows ARM to retrieve the authorized user's information.
   * **read\_repository** – Provides read access to the GitLab repository.
   * **write\_repository** – Provides write access to the GitLab repository.
6. Click **Save application**.

Use this updated note:

> **Note:** The **api, read\_user, read\_repository, and write\_repository** scopes are mandatory for the GitLab OAuth integration with ARM. Any additional scopes can be selected based on the **customer’s specific requirements and organizational security policies**.

After the application is created, copy the **Application ID** and **Secret** and use them as the **Client ID** and **Client Secret** when registering the repository in ARM.

> Copy and securely store the Application ID and Secret. The secret may only be available when the application is created.

#### Step 4: Configure the Repository in ARM

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2F5uwO9rgxltuNo5iVLKwF%2FFD058977-9095-4085-B373-EBEADE72DFF3.png?alt=media&amp;token=00189b48-24be-43aa-8baa-18688643516a" alt=""><figcaption></figcaption></figure>

Return to **Register Repository** in ARM and provide:

* **Display name**
* **Repository URL**
* **Client ID** – GitLab Application ID
* **Client secret** – GitLab application Secret

The Callback URL is automatically populated by ARM.

#### Step 5: Validate and Authorize

Click **Validate**.

You are redirected to GitLab, where the application requests permission to access your account and repository.

Review the requested permissions and click **Authorize**.

After successful authorization, you are redirected back to ARM and the connection is displayed as **Validated**.

#### Step 6: Select the Default Branch

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FVbNrl3oE9X4nqXC9SLVY%2FB4843CC4-CD96-40D0-80B2-0EC922295DDE_4_5005_c.jpeg?alt=media&amp;token=2cf5605e-9f5e-4051-b3f6-8aa18ff00a0f" alt=""><figcaption></figcaption></figure>

1. Click the **Fetch branches from the remote repository** icon next to **Default branch**.
2. Select the required branch, such as `main`.
3. Click **Save**.

The GitLab repository is now registered in ARM using OAuth authentication.

### Configure Pull Request Support

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FRN3Lon5rH7PECJ92nxgz%2FF72FFBD1-C480-4DBB-A242-7B548D94270A.png?alt=media&amp;token=4b120122-14ea-4d49-99f8-c927767cc722" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FgZBlNdjVib08QimUZ7up%2F0067771C-7956-4A37-9E22-E28639B6FC1A.png?alt=media&amp;token=7380654c-acc5-4c2d-8684-cf83baa0fff9" alt=""><figcaption></figcaption></figure>

If pull request support is required:

1. Open the registered repository in ARM.
2. Enable **Pull request support**.
3. Copy the **Pull request URL** generated by ARM.
4. Configure the URL in the applicable GitLab repository settings.
5. Select **GitLab Cloud** under **Pull request plugins**.
6. For GitLab SaaS, verify the **Host URL** as `https://gitlab.com`.
7. Save the configuration.

### Re-authorize the Connection

If OAuth access is revoked or the credentials are changed, open the repository configuration in ARM and validate the connection again. Complete the GitLab authorization when prompted and save the updated configuration.


---

# 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/arm-1/arm-features/version-control/introduction-to-version-control/configure-gitlab-oauth-for-repository-registration-in-arm.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.
