Skip to content

Updating visuals

If you see any images containing outdated UI, please bear with us.

We are updating all content as quickly as possible to mirror our new UI.

GitLab authentication ​

GitLab authentication lets your users sign in with the GitLab account they already use for code and projects. Once connected, you can offer “Continue with GitLab” in your WeWeb app.

What this integration supports ​

  • Social sign in with GitLab
  • Redirect to different pages for success, error, and first-time users

Setup in the GitLab dashboard ​

  1. Sign in to GitLab and open your profile settings.
  2. Go to Applications (sometimes under Preferences).
  3. Create a new application.
  4. Add a redirect URL (the URL GitLab sends users back to after login).
    • Use the WeWeb callback URL: the address of your app followed by /api/auth/callback/gitlab. The table below lists the URLs to add.
  5. Save the application and copy the values GitLab provides:
    • Application ID (use this as Client ID in WeWeb)
    • Secret (use this as Client Secret in WeWeb)

Add one callback URL for each place where users sign in:

Where users sign inCallback URL to add in GitLab
Editorhttps://<your-project>-editor.weweb.io/api/auth/callback/gitlab
Staging apphttps://<your-project>-staging.weweb.io/api/auth/callback/gitlab
Published apphttps://<your-project>-production.weweb.io/api/auth/callback/gitlab
Custom domainhttps://your-domain.com/api/auth/callback/gitlab

Replace <your-project> with your project's WeWeb subdomain. You can see it in your browser's address bar when the editor is open, for example bright-harbor in https://bright-harbor-editor.weweb.io.

CALLBACK URL VS SUCCESS PAGE

GitLab always sends users back to the callback URL, never to a page of your app. WeWeb then completes sign in and takes users to the Success Page, Error Page, or New User Page you choose in the Sign in with social provider action. Do not add the URL of these pages in GitLab.

Connect GitLab in WeWeb ​

  1. In the WeWeb editor, open the Data & API tab, then open the Authentication subtab and go to SSO Providers.
  2. Select GitLab and turn on the Enable toggle.
  3. Paste the credentials into the fields shown in WeWeb (Client ID and Client Secret).
  4. Click Save.

Test sign in ​

  1. In Interface, add a “Continue with GitLab” button.
  2. Create a workflow on click and add Sign in with social provider.
  3. Set:
    • Provider: gitlab
    • Success Page, Error Page, and (optional) New User Page
  4. Preview and complete the GitLab sign-in flow.

Common pitfalls ​

Redirect URL mismatch ​

Make sure the redirect URL in GitLab exactly matches the WeWeb callback URL (including https:// and the /api/auth/callback/gitlab path, with no trailing slash), not the Success Page URL you selected in WeWeb.

Using the wrong GitLab host ​

If you use a self-hosted GitLab instance, make sure you created the application in the correct GitLab environment (not on gitlab.com).

Reference ​

Setting in WeWebDescriptionWhere to find it in GitLab
Client IDIdentifies your GitLab application.Applications page (Application ID).
Client SecretUsed to complete the sign-in flow securely.Applications page (Secret).

FAQs ​

Which redirect URL should I add in GitLab?

Add the address of your app followed by /api/auth/callback/gitlab, for example https://your-domain.com/api/auth/callback/gitlab. Add one for each place where users sign in (editor, staging app, published app, custom domain). The URL of your Success Page is not the redirect URL.