# GitLab as your sign in option

Scalekit enables apps to easily let users sign in using GitLab as their social connector. This guide walks you through the process of setting up the connection between Scalekit and GitLab, and using the Scalekit SDK to add "Sign in with GitLab" to your application.

<figure>
  ![A diagram showing "Your Application" connecting to "Scalekit" via OpenID Connect, which links to GitLab using OAuth 2.0.](@/assets/docs/common/poster-scalekit-social.png)
</figure>

By the end of this guide, you will be able to:

1. Set up an OAuth 2.0 connection between Scalekit and GitLab
2. Scalekit SDK to add "Sign in with GitLab" to your application

## Set up GitLab connection

### Access social login settings

Open your Scalekit dashboard and navigate to Social Login under the Authentication section.

<figure>
  ![Scalekit dashboard showcasing social login setup with various platform integration options.](@/assets/docs/common/social-connections/1-navigate-to-social-logins.png)
</figure>

### Add GitLab connection

Click the "+ Add Connection" button and select GitLab from the list of available options.

<figure>
  ![Add social login connections: Google, Microsoft, GitHub, GitLab, Salesforce.](@/assets/docs/common/social-connections/2-list-social-logins.png)
</figure>

## Configure OAuth settings

The OAuth Configuration details page helps you set up the connection:

- Note the **Redirect URI** provided for your app. You'll use this URL to register with GitLab.
- **Client ID** and **Client Secret** are generated by GitLab when you register an OAuth App. They enable Scalekit to
  authenticate your app and establish trust with GitLab.

<figure>
  ![GitLab OAuth configuration for social login, showing redirect URI, client ID, and scopes for
  authentication.](@/assets/docs/guides/social-connections/gitlab-1.png)
</figure>

### Set up GitLab OAuth 2.0

GitLab lets you set up OAuth through the Microsoft Identity Platform.
<a href="https://docs.gitlab.co.jp/ee/integration/oauth_provider.html" target="_blank" rel="noopener">Follow GitLab's instructions to set up OAuth 2.0</a>.

1. Navigate to GitLab's OAuth Applications settings page
2. Click "New Application" to create a new OAuth application
3. Fill in the application details:
   - Name: Your app's name
   - Redirect URI: Use the Redirect URI from Scalekit
   - Scopes: Select the required scopes for your application
4. Click "Save application" to create the OAuth App
5. Copy the generated Application ID and Secret
6. Paste these credentials into the Scalekit Dashboard
7. Click "Save Changes" in Scalekit to complete the setup
<figure>
  ![GitLab OAuth configuration for social login, showing redirect URI, client ID, and scopes for
  authentication.](@/assets/docs/guides/social-connections/gitlab-2.png)
</figure>

## Test the connection

Click the "Test Connection" button in Scalekit. You will be redirected to the GitLab Consent screen to authorize access.
A summary table will show the information that will be sent to your app.

<figure>
  ![Test connection success](@/assets/docs/common/social-connections/5-successful-test-connection.png)
</figure>