Appearance
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
- Sign in to GitLab and open your profile settings.
- Go to
Applications(sometimes underPreferences). - Create a new application.
- 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.
- Use the WeWeb callback URL: the address of your app followed by
- Save the application and copy the values GitLab provides:
Application ID(use this asClient IDin WeWeb)Secret(use this asClient Secretin WeWeb)
Add one callback URL for each place where users sign in:
| Where users sign in | Callback URL to add in GitLab |
|---|---|
| Editor | https://<your-project>-editor.weweb.io/api/auth/callback/gitlab |
| Staging app | https://<your-project>-staging.weweb.io/api/auth/callback/gitlab |
| Published app | https://<your-project>-production.weweb.io/api/auth/callback/gitlab |
| Custom domain | https://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
- In the WeWeb editor, open the
Data & APItab, then open theAuthenticationsubtab and go toSSO Providers. - Select
GitLaband turn on theEnabletoggle. - Paste the credentials into the fields shown in WeWeb (
Client IDandClient Secret). - Click
Save.
Test sign in
- In
Interface, add a “Continue with GitLab” button. - Create a workflow on click and add
Sign in with social provider. - Set:
Provider:gitlabSuccess Page,Error Page, and (optional)New User Page
- 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 WeWeb | Description | Where to find it in GitLab |
|---|---|---|
Client ID | Identifies your GitLab application. | Applications page (Application ID). |
Client Secret | Used 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.

