Skip to content

GitLab

Trustle reads users, groups, projects, and their members from GitLab. Trustle can add and remove group and project members, and set their access level.

  • An identity provider connected in Trustle, for example Okta or Microsoft Entra ID. Trustle hides SaaS Applications until one is connected.
  • One of these accounts for Trustle:
    • Group service account: needs the Owner role in the top-level group. On self-managed GitLab, an administrator can also create it. It does not use a seat, and it cannot sign in to the GitLab UI. Service accounts are on every tier in recent GitLab versions, but the limits differ by version and by instance.
    • Dedicated user account: works on every GitLab tier. A GitLab administrator creates it, or on GitLab.com a group Owner invites it by email. It uses a seat, and it can sign in to the GitLab UI unless you restrict it.
  • For self-managed GitLab: Trustle must reach the instance over HTTPS.

Use a group service account if your tier has one. Otherwise, use a dedicated user account.

  1. In GitLab, open your top-level group. Go to Settings → Service accounts.
  2. Click Add service account.
  3. Enter a name, for example trustle-integration. GitLab makes a username such as service_account_group_<id>_<random>. You can change it.
  4. Click Create service account.
  1. Create the user, for example trustle-service, with an email such as trustle-service@company.com. On self-managed GitLab or GitLab Dedicated, a GitLab administrator creates it. On GitLab.com, a group Owner invites the email address, and the invitee creates the account. Set a strong password; you need it only for setup. Mark the user as an External user if it must not see internal projects.
  2. On self-managed GitLab, give the user the Administrator access level if you want Trustle to read every user’s email. See Step 3.

GitLab gives a new account no access. Trustle imports the groups that the account can see and the projects that it is a member of. With the Administrator access level, the account sees every group. You can also add the account to single projects instead of a whole group.

  1. Open the top-level group. Go to Manage → Members.
  2. Click Invite members.
  3. Search for the account username from Step 1.
  4. Select the Owner role. Click Invite.
  5. Do this for each top-level group that Trustle must read.

The account gets the same access to every subgroup and project below the group.

Permission Required What Trustle does with it
api token scope Yes Calls the GitLab API. Test Connection uses it.
Group membership (Step 2) Yes Imports the groups, projects, and members that the account can see. Without it, the sync imports nothing. Test Connection does not check it.
Owner role in each group Yes Adds and removes group and project members at every access level. With a lower role, GitLab refuses some changes. Only an Owner can give the Owner role.
Administrator access level (self-managed, Option B only) Optional Reads every user’s email, so Trustle can link GitLab users to Trustle users. Without it, GitLab returns only the email that each user made public. Users with no public email stay unlinked.

For Option A:

  1. In the top-level group, go to Settings → Service accounts.
  2. Select the service account. Open its access tokens and click Add new token.
  3. Continue at the token form below.

For Option B:

  1. Sign in to GitLab as the dedicated user.
  2. Go to User settings → Access tokens. Click Add new token.
  3. Continue at the token form below.

On the token form:

  1. Enter a Token name, for example Trustle.
  2. Set an Expiration date that matches your security policy. GitLab allows at most 365 days by default. Some GitLab 17.6 and later instances allow 400 days, if an administrator turned it on. GitLab Dedicated does not.
  3. Under Scopes, select api.
  4. Click Create personal access token. Copy the token.
Trustle field Where to find it in GitLab Example
GitLab URL (Optional) Leave it empty for GitLab.com. For self-managed GitLab, enter the instance address. It must start with https://. https://gitlab.example.com
Personal Access Token The token from Step 4 glpat-…
  1. In Trustle, go to Connections.
  2. Under SaaS Applications, find GitLab and click Connect.
  3. Enter a Connection Name, for example GitLab production. Description is optional.
  4. Enter the values from Step 5.
  5. Click Test Connection.
  6. After the test passes, click Save Connection.
  1. On the Connections page, open the GitLab connection.
  2. Wait for the first sync to finish.
  3. Check that Trustle shows the groups and projects from Step 2.
  4. Check that GitLab users are linked to Trustle users. An unlinked user has no email in GitLab.

If something is missing, see Troubleshooting.

  • Personal Access Token: check that the token has not expired and is not revoked. It must have the api scope.
  • GitLab URL: leave it empty for GitLab.com. For self-managed GitLab, the address must start with https://.

Test Connection passes, but the sync imports no groups or projects

Section titled “Test Connection passes, but the sync imports no groups or projects”

The account is not a member of any group. GitLab does not add a new service account to its group. Do Step 2. Then run the sync again.

GitLab users are not linked to Trustle users

Section titled “GitLab users are not linked to Trustle users”

GitLab returns a user’s email only to an administrator token, or when the user made the email public. Do one of these:

  • On self-managed GitLab, give the Trustle account the Administrator access level.
  • Ask each user to set a Public email in their GitLab profile.

Trustle links the users after the next sync.

Trustle reads the last-used date from each user’s GitLab activity. A service account that uses only the API often has no activity, so its date stays empty.

The account needs the Owner role in the group. Do Step 2.

Email support@trustle.com. Include the error message, the connection name, and the GitLab URL (or GitLab.com) and the top-level group name. Never send a secret, key, or token.