# Connecting GitLab Login

To let shoppers sign up with a GitLab account, you first register your service with GitLab and receive two values. They are the Application ID and the Secret.

This page covers the order in which you receive those two values. Putting the values you received into WEEGLOO is covered in [Putting the values you received into WEEGLOO](#back-to-weegloo).

## The address to copy first {#redirect-uri}

When a shopper finishes logging in at GitLab, GitLab sends the result back to a set address. You have to register this address with GitLab, so copy it first. You paste it in step 1.

Pick your *Space* below and you get the address with the identifier filled in.

```weegloo-redirect-uri
{
  "template": "https://auth.weegloo.com/v1/spaces/{spaceId}/login/oauth2/code/{provider}",
  "provider": "gitlab"
}
```

:::note
If you would rather fill it in yourself, put the identifier of your *Space* in the `{spaceId}` slot. Open that *Space* in the content studio and look at the browser address bar. The value that comes after `/spaces/` is the identifier.

This address is not your site's address. It is where WEEGLOO receives the login result. So it is settled now even if you have not built your site yet. If you turned on **GitLab** in the content studio, the same address appears in **Step 1**, so you can copy it from there.
:::

## Getting the two values from GitLab {#get-credentials}

Sign in to GitLab, then work through the two steps below in order. What you do here costs nothing.

::::step{title="Registering an application"}
1. Open the applications screen (<https://gitlab.com/-/user_settings/applications>).
2. Click **Add new application**.

   ![The Applications screen. It holds the Your applications and Authorized applications areas, the list is empty, and the Add new application button is at the top right](/_img/en-US/getting-started/core-concepts/service-users/service-login/images/gitlab-01-applications.webp)

3. In **Name**, enter the name of this application (for example, `Cozy Closet`).
4. In the **Redirect URI** box, paste the address you copied in [The address to copy first](#redirect-uri).

   ![The Add new application form. Name holds "Cozy Closet", Redirect URI holds the WEEGLOO address, and the Confidential checkbox below it is checked](/_img/en-US/getting-started/core-concepts/service-users/service-login/images/gitlab-02-register-form.webp)

5. In **Scopes**, check only `read_user`.

   ![The Scopes list. api and read_api are off, and only read_user is on](/_img/en-US/getting-started/core-concepts/service-users/service-login/images/gitlab-03-scopes.webp)

6. Click **Save application** at the very bottom of the form.

:::note
The **Redirect URI** box takes several lines, but the only thing to enter is the single address you copied above. **Confidential** below it is on from the start, and WEEGLOO receives and keeps the Secret, so leave it on. You have to choose at least one scope before the form will save.
:::
::::

::::step{title="Copying the Application ID and the Secret"}
When you click **Save application**, the screen of the application you just created opens. The two values you will put into WEEGLOO are here.

1. Click the copy icon to the right of **Application ID** to copy the value.
2. Click the copy icon to the right of **Secret** to copy the value.

   ![The Application ID value, the hidden Secret, the Renew secret button next to it, and the notice that the Secret can be seen only this once are visible](/_img/en-US/getting-started/core-concepts/service-users/service-login/images/gitlab-04-credentials.webp)

:::note{variant="warning" title="You can see the Secret only this once"}
**Application ID** stays on this screen, so you can see it again whenever you want. The **Secret** does not. If you lose it, create a new one with **Renew secret**, and put the new value into WEEGLOO again. The Secret is a secret value. Do not tell it to anyone, and do not write it down anywhere public.
:::
::::

## Putting the values you received into WEEGLOO {#back-to-weegloo}

Now you have the two values in hand. From here the path splits depending on how you have been working so far.

If you were configuring this directly in the content studio, follow these steps.

1. Go back to turning on social login in [Service Member Login](/getting-started/core-concepts/service-users/service-login.md#turning-on-social-login).
2. Turn on **GitLab**.
3. Enter the Application ID in the **Application ID** box in **Step 2**.
4. Enter the Secret in the **Secret** box.
5. Click **Save**.

If you handed the integration to an AI agent and were told to go and get the values, paste the two values you received into the chat as they are and carry on with what you were doing. The agent handles the rest of the configuration from there.

## What to do next {#what-to-do-next}

- [Service Member Login](/getting-started/core-concepts/service-users/service-login.md): put the values you received into the content studio and finish the rest of the member login configuration.
- [Member Roles and Permissions](/getting-started/core-concepts/service-users/service-user-role.md): create the *ServiceUserRole* that decides what a signed-up member can see and use.
- [Auth API](/api/reference/auth-api.md): covers technical specifications such as the request format you need when wiring login into your own site's code.
