Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
| 1 | ## How do I set up custom OAuth credentials for GitLab? |
| 2 | |
| 3 | Use your own GitLab OAuth application when you want users to see your app's name on the consent screen, or when you connect to a self-managed GitLab instance. |
| 4 | |
| 5 | ### Create the GitLab app |
| 6 | |
| 7 | 1. Sign in to GitLab, click your avatar in the top-right corner, and select **Edit profile**. |
| 8 | 2. In the left sidebar, click **Applications** (direct link on GitLab.com: `https://gitlab.com/-/profile/applications`). On a self-managed instance, use the same path on your own host. |
| 9 | |
| 10 |  |
| 11 | 3. Click **New application** and enter a name, such as `Composio GitLab Integration`. |
| 12 | 4. In **Redirect URI**, paste `https://backend.composio.dev/api/v1/auth-apps/add` with no trailing `/`. It must exactly match the `oauth_redirect_uri` field in your Composio auth config. |
| 13 | |
| 14 |  |
| 15 | 5. Select the scopes your integration needs, then click **Save application**. |
| 16 | 6. Copy the **Application ID** (your Client ID) and the **Secret** (your Client Secret). GitLab shows the secret only once. |
| 17 | |
| 18 |  |
| 19 | |
| 20 | ### Create the auth config in Composio |
| 21 | |
| 22 | 1. In the Composio dashboard, go to **Auth Configs**, click **Create Auth Config**, and select **GitLab**. |
| 23 | 2. Set the authentication type to **OAuth2** and choose **Use your own developer authentication**. |
| 24 | |
| 25 |  |
| 26 | 3. Paste the Application ID as **Client ID** and the Secret as **Client Secret**. Add the same scopes you selected in GitLab, then click **Create GitLab Auth Config**. |
| 27 | 4. Click **Connect Account**, approve the permissions on the GitLab consent screen, and confirm the account shows as **Active**. |
| 28 | |
| 29 | See [Custom auth configs](/docs/auth-configuration/custom-auth-configs) for the general flow. |
| 30 | |
| 31 | ### Scopes |
| 32 | |
| 33 | The default auth config requests `api`, `read_api`, `read_user`, `read_repository`, `write_repository`, `profile`, and `email`. `api` grants full read/write API access; use `read_api` instead for read-only access. Select only the scopes you need in the GitLab app and use the same list in the auth config. |
| 34 | |
| 35 | ### Self-managed GitLab |
| 36 | |
| 37 | The OAuth2 auth config has two URL fields: |
| 38 | |
| 39 | - `full`: your GitLab server URL with `/api/v4` appended. The default is `https://gitlab.com/api/v4`. |
| 40 | - `authorizationUrl`: your GitLab server URL without the API path. The default is `https://gitlab.com`. |
| 41 | |
| 42 | For a self-managed instance, create the OAuth application on that instance and set both fields to your instance's URL, for example `https://gitlab.example.com/api/v4` and `https://gitlab.example.com`. |