nx/docs/nx-cloud/private/auth-gitlab.md
Isaac Mann 9721844b05
Nx Cloud docs (#10690)
* docs(nxdev): consume nx cloud documentation & dedicated menu

* docs(nxdev): nx-cloud docs

visually indicated nx-cloud docs in nx.dev

* docs(nxdev): formatting

visually indicated nx-cloud docs in nx.dev

* docs(nxdev): fix config

* docs(nxdev): fix header link

* docs(nxdev): consolidate dte set up guides

Co-authored-by: ben <3447705+bcabanes@users.noreply.github.com>
2022-06-11 02:22:49 +00:00

1.5 KiB

Nx Private Cloud GitLab Auth

Before creating your container, you'll need to create a GitLab app for your organisation.

Creating a GitLab app

From GitLab, click on your profile picture and chose "Preferences":

Step 1

Then "Applications" from the left-hand menu:

Step 2

Give the app a name. The authorization callback is the important bit. It needs to be in this form:

[your-nx-cloud-url]/auth/gitlab/callback

Important: Ensure there is no backslash at the end of the "Redirect URI" (i.e. it matches the above pattern)

Step 3

Ensure you grant it the "read_user" scope:

Step 4

Click "Save".

Once you create, keep a note of the Client ID and the Secret:

Step 5

Connect your private cloud instance to your new app

When setting up your private cloud, you can pass these two environment variables to it:

GITLAB_APP_ID=...
GITLAB_APP_SECRET=...

Use the App ID and App Secret from when you created the app above.

On-premise GitLab

If you are running an on-premise version of GitLab, you will need to configure one additional environment variable:

GITLAB_API_URL=https://custom-gitlab-instance.com

This will point all auth endpoints to your GitLab server (rather the public one).