---
description: >-
  Example instructions for setting up GitLab as a single sign-on source via
  OIDC.
---

# GitLab OIDC Setup Guide

If you'd like to set up the ability to sign in to your Spacelift account using an OIDC integration with GitLab, you've come to the right place. This example will walk you through the steps to get this setup, and you'll have single sign-on running in no time!

### Pre-requisites

* Spacelift account, with access to admin permissions
* GitLab account, with permission to create GitLab Applications

{% hint style="info" %}
Please note you'll need to be an admin on the Spacelift account to access the account settings to configure Single Sign-On.
{% endhint %}

### Configure Account Settings

You'll need to visit the Spacelift account settings page to set up this integration, from the navigation side bar menu, select "Settings."

![](https://3862190545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LshwwDZmA4HXN0k9e8O%2Fuploads%2FbUc29SIelZ5BOpegEucJ%2FScreen%20Shot%202022-07-01%20at%204.12.30%20PM.png?alt=media\&token=fc936906-984d-4a26-9d2a-b5d42ca5a266)

### Setup OIDC

Next, you'll want to click the Set Up box underneath the "OIDC Settings" section. This will expand some configuration we will need to fill out in a few minutes, which we will be obtaining from GitLab. For now **copy the authorized redirect URL** as we will need to provide GitLab this URL when configuring our GitLab application.

![](https://3862190545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LshwwDZmA4HXN0k9e8O%2Fuploads%2FUQah8uGthHUNGAmTH4s7%2FScreen%20Shot%202022-07-01%20at%204.16.00%20PM.png?alt=media\&token=275f9c2c-95c3-43f0-ad5e-0a4735bfa751)

### GitLab: Create GitLab Application

Within your GitLab account, visit the **Applications** section of your account.

![Navigate to GitLab Applications within your account.](https://3862190545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LshwwDZmA4HXN0k9e8O%2Fuploads%2FUnKBxlzMh1vSxpmpD7gz%2F1-gitlab-applications.png?alt=media\&token=6284c236-0b08-4c88-92d2-07eaa911f6bb)

Create your GitLab Application as shown, the application's **Name** can be whatever you'd like. Spacelift sounds like a great name to use though :clap:.

Remember the **authorized redirect URL** we copied earlier from Spacelift? We'll need that in this step. You'll want to paste that URL into the **Redirect URI** input as shown.

Ensure that the **openId**, **profile** and **email** scopes are check'd.

Click **Save Application**.

![Complete the GitLab Application Configuration](https://3862190545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LshwwDZmA4HXN0k9e8O%2Fuploads%2F7HCPmELDa8dcMrSVkX7V%2F2-gitlab-create-application-settings.png?alt=media\&token=1ec9efaa-fc5d-410e-a6cd-324d14406f19)

### Configure OIDC Settings

Now that we have the GitLab Application setup, we'll need to take the **Application ID** and **Secret** to configure the Spacelift OIDC Settings.&#x20;

**Application ID** = Spacelift's **Client ID**

**Secret** = Spacelift's Secret

In Spacelift, the **Provider URL** depends on where you are using GitLab, if you are using **GitLab.com** this value can be set as **https://gitlab.com**

{% hint style="info" %}
When setting your Provider URL within Spacelift, **do not include a trailing slash** "/" at the end of your URL or you may receive an error.
{% endhint %}

![Copy the Application ID and Secret values to your Spacelift OIDC configuration](https://3862190545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LshwwDZmA4HXN0k9e8O%2Fuploads%2FWHl2Rfiv1T9k0LLxnz3n%2F3-gitlab-copy-values.png?alt=media\&token=87d6a2c3-1271-4a71-b38f-51bfa58fd2a8)



![Copy the values from GitLab into your Spacelift OIDC Settings.](https://3862190545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LshwwDZmA4HXN0k9e8O%2Fuploads%2Fe1i0vSnFLx0W9uE26y25%2F4-spacelift-oidc-configuration.png?alt=media\&token=7c5d654d-7fff-41b1-8c98-5b59d91ccc98)

### GitLab OIDC Setup Completed <a href="#okta-oidc-setup-completed" id="okta-oidc-setup-completed"></a>

That's it! Your OIDC integration with GitLab should now be fully configured.&#x20;

