GitLab · Authentication Profile

Gitlab Authentication

Authentication

GitLab secures its APIs with apiKey, http, and oauth2 across 5 declared security schemes, as derived from its OpenAPI definitions.

CodeDeveloper ToolsPlatformSoftware DevelopmentVersion ControlGitLab
Methods: apiKey, http, oauth2 Schemes: 5 OAuth flows: API key in: header, query

Security Schemes

oauthToken http
scheme: bearer
privateToken apiKey
· in: header (PRIVATE-TOKEN)
jobToken apiKey
· in: header (JOB-TOKEN)
sessionCookie apiKey
· in: cookie (_gitlab_session)
impersonationAndSudo apiKey
· in: header (Sudo)

Source

Authentication Profile

Raw ↑
generated: '2026-11-05'
method: searched
source: https://docs.gitlab.com/api/rest/authentication/
docs: https://docs.gitlab.com/api/rest/authentication/
summary:
  types:
  - apiKey
  - http
  - oauth2
  api_key_in:
  - header
  - query
note: 'Most API requests require authentication or return only public data. Missing/invalid credentials return 401 {"message": "401 Unauthorized"}; insufficient scope returns a WWW-Authenticate Bearer challenge
  listing the required scopes. Deploy tokens cannot be used with the public API. Using the API to generate a new session cookie is not supported.'
schemes:
- name: oauthToken
  type: http
  scheme: bearer
  description: 'OAuth 2.0 access token, passed as Authorization: Bearer or access_token query parameter (not both). Access tokens are valid for two hours; refresh with refresh_token.'
  docs: https://docs.gitlab.com/api/oauth2/
  sources:
  - openapi/gitlab-oauth2-openapi.yml
  - openapi/gitlab-webhooks-openapi.yml
  - https://docs.gitlab.com/api/rest/authentication/
- name: privateToken
  type: apiKey
  in: header
  parameter: PRIVATE-TOKEN
  description: 'Personal, project or group access token; PRIVATE-TOKEN header is recommended, also accepted as Authorization: Bearer. Project access tokens on GitLab.com require Premium or Ultimate.'
  sources:
  - openapi/gitlab-webhooks-openapi.yml
  - openapi/gitlab-openapi-original.yml
  - https://docs.gitlab.com/api/rest/authentication/
- name: jobToken
  type: apiKey
  in: header
  parameter: JOB-TOKEN
  description: CI/CD job token ($CI_JOB_TOKEN), specific endpoints only.
  docs: https://docs.gitlab.com/ci/jobs/ci_job_token/
  sources:
  - https://docs.gitlab.com/api/rest/authentication/
- name: sessionCookie
  type: apiKey
  in: cookie
  parameter: _gitlab_session
  description: Set by signing in to the GitLab web app; the API uses it if present.
  sources:
  - https://docs.gitlab.com/api/rest/authentication/
- name: impersonationAndSudo
  type: apiKey
  in: header
  parameter: Sudo
  description: Administrators can act as a specific user with impersonation tokens (a type of personal access token) or Sudo (sudo query parameter or Sudo header, token needs the sudo scope).
  sources:
  - https://docs.gitlab.com/api/rest/authentication/
see:
- scopes/gitlab-scopes.yml
- conventions/gitlab-conventions.yml

Work with this as data

Every security artifact here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for security posture

4 MCP tools reach this
  • find_securityBrowse and filter every security artifact in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This security artifact
curl "https://apis.io/api/v1/security/gitlab-authentication"
All security posture
curl "https://apis.io/api/v1/security?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.