Skip to content

Reference

GitLab

Set up GitLab OAuth for repositories, merge requests, issues, and CI/CD

Connect your users to GitLab for repositories, merge requests, issues, and CI/CD.

PropertyValue
Provider IDgitlab
CategoryDeveloper Tools
PKCESupported (S256)
Token refreshAutomatic (rotating refresh tokens)
Redirect URIShown in Developer Portal

Open GitLab Applications

Navigate to User Settings > Applications (or a group/instance-level Applications page for shared apps) and sign in.

Add a new application

Click Add new application and enter a name.

Configure the redirect URI

Add the Alter callback URL (from the Developer Portal) to the Redirect URI field. Keep Confidential checked.

Select scopes

Select the scopes the application needs. See Available Scopes below.

Get credentials

Click Save application, then copy the Application ID (Client ID) and Secret (Client Secret). The secret is only shown once.

Open the Developer Portal

Go to portal.alterauth.com and navigate to the application.

Add GitLab provider

Go to OAuth Providers > Add Provider > GitLab.

Enter credentials

  • Client ID: Paste your GitLab Application ID
  • Client Secret: Paste your GitLab Secret

Select scopes

Choose the scopes the application needs.

Save

Click Save. The provider is now active.

ScopeDescription
read_userRead-only access to the authenticated user’s profile
read_apiRead-only access to the API, including all groups and projects
apiFull read/write access to the API, including all groups and projects, the container registry, and the package registry
ScopeDescription
read_repositoryRead-only access to repositories on private projects via Git-over-HTTP or the Repository Files API
write_repositoryRead/write access to repositories on private projects via Git-over-HTTP (not the API)
read_registryRead-only (pull) access to container registry images on private projects
write_registryRead/write (push) access to container registry images on private projects
read_virtual_registryRead-only (pull) access to container images through the dependency proxy
write_virtual_registryRead/write access to container images through the dependency proxy
ScopeDescription
create_runnerCreate runners
manage_runnerManage runners
k8s_proxyPerform Kubernetes API calls via the agent for Kubernetes
read_observabilityRead-only access to GitLab Observability
write_observabilityWrite access to GitLab Observability
ScopeDescription
ai_featuresAccess GitLab Duo AI features
ai_workflowsAccess GitLab Duo agent platform workflows
mcpAccess the GitLab Model Context Protocol (MCP) server
openidAuthenticate with GitLab via OpenID Connect
profileRead-only access to the user’s profile data via OpenID Connect
emailRead-only access to the user’s primary email address via OpenID Connect
ScopeDescription
sudoPerform API actions as any user in the system (administrators only)
admin_modePerform API actions as an administrator when Admin Mode is enabled (administrators only)
ScopeDescription
mcp_orbitAccess the experimental GitLab MCP Orbit server
self_rotateRotate this token using the personal access token API
read_service_pingRead-only access to Service Ping payload data
user:*Composite user scope granted to service accounts for fine-grained access
  • Prefer read_api plus narrower scopes over api when the integration is read-only — api grants full read/write access.
  • OAuth access tokens expire after 2 hours; the rotating refresh token keeps the grant alive without re-authorization.
  • See the GitLab OAuth documentation for more details.

Alter policy rules can target these attested operations and families for operation-level and parameter-aware controls.

Operation IDFamiliesMethodProvider path
getApiV4ProjectsreadGET/api/v4/projects
getApiV4ProjectsIdreadGET/api/v4/projects/{id}
postApiV4ProjectswritePOST/api/v4/projects
putApiV4ProjectsIdadminPUT/api/v4/projects/{id}
deleteApiV4ProjectsIddeleteDELETE/api/v4/projects/{id}
getApiV4GroupsreadGET/api/v4/groups
getApiV4GroupsIdreadGET/api/v4/groups/{id}
getApiV4GroupsIdProjectsreadGET/api/v4/groups/{id}/projects
getApiV4ProjectsIdIssuesreadGET/api/v4/projects/{id}/issues
getApiV4ProjectsIdIssuesIssueIidreadGET/api/v4/projects/{id}/issues/{issue_iid}
postApiV4ProjectsIdIssueswritePOST/api/v4/projects/{id}/issues
putApiV4ProjectsIdIssuesIssueIidwritePUT/api/v4/projects/{id}/issues/{issue_iid}
getApiV4ProjectsIdMergeRequestsreadGET/api/v4/projects/{id}/merge_requests
getApiV4ProjectsIdMergeRequestsMergeRequestIidreadGET/api/v4/projects/{id}/merge_requests/{merge_request_iid}
postApiV4ProjectsIdMergeRequestswritePOST/api/v4/projects/{id}/merge_requests
putApiV4ProjectsIdMergeRequestsMergeRequestIidwritePUT/api/v4/projects/{id}/merge_requests/{merge_request_iid}
getApiV4ProjectsIdJobsreadGET/api/v4/projects/{id}/jobs
getApiV4ProjectsIdPipelinesreadGET/api/v4/projects/{id}/pipelines
postApiV4ProjectsIdPipelinewritePOST/api/v4/projects/{id}/pipeline
getApiV4ProjectsIdReleasesreadGET/api/v4/projects/{id}/releases
postApiV4ProjectsIdReleaseswritePOST/api/v4/projects/{id}/releases
getApiV4ProjectsIdRepositoryBranchesreadGET/api/v4/projects/{id}/repository/branches
postApiV4ProjectsIdRepositoryBrancheswritePOST/api/v4/projects/{id}/repository/branches
getApiV4ProjectsIdRepositoryCommitsreadGET/api/v4/projects/{id}/repository/commits
postApiV4ProjectsIdRepositoryCommitswritePOST/api/v4/projects/{id}/repository/commits
getApiV4ProjectsIdRepositoryTagsreadGET/api/v4/projects/{id}/repository/tags
getApiV4ProjectsIdRepositoryTreereadGET/api/v4/projects/{id}/repository/tree
getApiV4UserreadGET/api/v4/user
getApiV4UsersreadGET/api/v4/users
getApiV4UsersIdreadGET/api/v4/users/{id}

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.