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
Log in to ARM.
Navigate to Settings → Repositories.
Click Register repository.
Select:
Version control system: GIT
Git provider: GitLab
Access type: OAuth
The OAuth configuration fields are displayed.

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

Log in to GitLab and navigate to:
User Settings → Access → Applications
Under Your applications, click Add new application.
Enter an application Name.
Paste the ARM Callback URL into the Redirect URI field.
Keep Confidential enabled.
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.
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

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

Click the Fetch branches from the remote repository icon next to Default branch.
Select the required branch, such as
main.Click Save.
The GitLab repository is now registered in ARM using OAuth authentication.
Configure Pull Request Support


If pull request support is required:
Open the registered repository in ARM.
Enable Pull request support.
Copy the Pull request URL generated by ARM.
Configure the URL in the applicable GitLab repository settings.
Select GitLab Cloud under Pull request plugins.
For GitLab SaaS, verify the Host URL as
https://gitlab.com.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.
Last updated
Was this helpful?

