You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
24
24
- Upgraded `hono` to `^4.12.24`. [#1289](https://github.com/sourcebot-dev/sourcebot/pull/1289)
25
25
- Surfaced an actionable error when the Lighthouse licensing service is unreachable, instead of a generic "unexpected error". [#1293](https://github.com/sourcebot-dev/sourcebot/pull/1293)
26
26
- Fixed the selected language model rapidly flipping in local storage after a language model was removed. [#1295](https://github.com/sourcebot-dev/sourcebot/pull/1295)
27
+
- Fixed issue where using multiple identity providers of the same type (e.g., gitlab) would result in unexpected behaviours. [#1177](https://github.com/sourcebot-dev/sourcebot/pull/1177)
Copy file name to clipboardExpand all lines: docs/docs/configuration/idp.mdx
+48-1Lines changed: 48 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ import LicenseKeyRequired from '/snippets/license-key-required.mdx'
10
10
You can connect Sourcebot to various **external identity providers** to associate a Sourcebot user with one or more external service accounts (ex. Google, GitHub, etc).
11
11
12
12
External identity providers can be used for [authentication](/docs/configuration/auth) and/or [permission syncing](/docs/features/permission-syncing). They're defined in the
13
-
[config file](/docs/configuration/config-file) in the top-level `identityProviders`object:
13
+
[config file](/docs/configuration/config-file) in the top-level `identityProviders`array:
14
14
15
15
```json wrap icon="code" Example config with both google and github identity providers defined
16
16
{
@@ -42,6 +42,8 @@ External identity providers can be used for [authentication](/docs/configuration
42
42
43
43
Secret values (such as `clientId` and `clientSecret`) can be provided as environment variables or Google Cloud secrets via [tokens](/docs/configuration/config-file#tokens).
44
44
45
+
To configure **multiple providers of the same type**, see [Configuring multiple providers of the same type](#configuring-multiple-providers-of-the-same-type).
46
+
45
47
# Supported External Identity Providers
46
48
47
49
Sourcebot uses [Auth.js](https://authjs.dev/) to connect to external identity providers. If there's a provider supported by Auth.js that you don't see below, please submit a
@@ -642,4 +644,49 @@ GCP IAP works differently from other identity providers. Instead of redirecting
642
644
</Steps>
643
645
</Accordion>
644
646
647
+
# Configuring multiple providers of the same type
648
+
649
+
By default, each provider in the `identityProviders` array is identified by an **id** equal to its `provider` value. This id determines the provider's OAuth **callback URL** (sometimes called the redirect URL):
650
+
651
+
```
652
+
<sourcebot_url>/api/auth/callback/<id>
653
+
```
654
+
655
+
This is why the examples above register callback URLs like `<sourcebot_url>/api/auth/callback/github`. The array form supports only **one instance per provider type**.
656
+
657
+
To configure **multiple instances of the same provider type** (for example, gitlab.com alongside a self-hosted GitLab instance), switch `identityProviders` to its object form, where you assign each provider a unique id:
658
+
659
+
```json wrap icon="code" Two GitLab providers, one for gitlab.com and one for a self-hosted instance
Each provider keeps the same fields documented above. The only differences are:
683
+
684
+
-`identityProviders` is an **object** keyed by id instead of an array.
685
+
- The id you choose (`gitlab-cloud`, `gitlab-selfhosted`) sets the callback URL, so you register `<sourcebot_url>/api/auth/callback/gitlab-cloud` and `<sourcebot_url>/api/auth/callback/gitlab-selfhosted` with their respective OAuth clients.
686
+
- Set an optional `displayName` on each provider to give it a distinct label on the login screen. Without it, both instances fall back to the same provider-type name (for example, "GitLab"), making them hard to tell apart.
687
+
688
+
<Note>
689
+
Each instance needs its own OAuth client (its own `clientId` and `clientSecret`) registered with the matching callback URL.
0 commit comments