Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e277c6b
sign up copy nits
msukkari Jul 10, 2025
846d2d0
first pass at new onboarding page
msukkari Jul 11, 2025
61a0b33
wip join onboard logic
msukkari Jul 11, 2025
6f46518
refactor auth provider fetch logic
msukkari Jul 12, 2025
955d60e
add member approval and invite link flag logic
msukkari Jul 12, 2025
44b8370
update join request flow and remove jit logic
msukkari Jul 12, 2025
a0fb330
onboard guard
msukkari Jul 12, 2025
6943ccf
nits, onboard role check, invite link enabled check
msukkari Jul 12, 2025
22d68a6
fix bg color issue in onboarding page
msukkari Jul 12, 2025
57c94f1
refactor onboard UI
msukkari Jul 12, 2025
6191bca
ui nits and more onboarding resource cards
msukkari Jul 12, 2025
d221657
revamp auth docs
msukkari Jul 13, 2025
644d46a
change member approval default behavior and updated docs
msukkari Jul 13, 2025
1ef491b
merge prisma migrations
msukkari Jul 13, 2025
4b68ed9
add id to resource card
msukkari Jul 13, 2025
e1a7d0d
feedback
msukkari Jul 13, 2025
1ba266a
feedback
msukkari Jul 14, 2025
f781ab1
feedback and fixed build
msukkari Jul 14, 2025
97fc0c3
settings drop down UI nit
msukkari Jul 14, 2025
abe959b
ui nits
msukkari Jul 14, 2025
04edbed
handle join when max capacity case
msukkari Jul 14, 2025
86189b2
add news data for member toggle
msukkari Jul 14, 2025
7b3e6e7
refactor for public access case
msukkari Jul 15, 2025
bdfef1c
add iap bridge to onboard logic
msukkari Jul 15, 2025
22b9e53
fetch member approval req and invite link enabled flag on server
msukkari Jul 15, 2025
db6ab06
ui nits
msukkari Jul 15, 2025
5819708
fix invite link enable toggle snapping issue
msukkari Jul 15, 2025
cf18a0d
ui nits
msukkari Jul 15, 2025
c714555
styling and ui nits, pass in invite id from server
msukkari Jul 15, 2025
96c5fc2
add mcp resource in onboard step
msukkari Jul 15, 2025
81e6b61
get invite link in server
msukkari Jul 15, 2025
b15b13a
Merge branch 'main' into msukkarieh/onboard
msukkari Jul 15, 2025
71ced6a
fix build issue
msukkari Jul 15, 2025
2666469
refactor docs on config
msukkari Jul 15, 2025
7ea5437
minor doc nit
msukkari Jul 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Fixed issue with external source code links being broken for paths with spaces. [#364](https://github.com/sourcebot-dev/sourcebot/pull/364)
- Revamped onboarding experience. [#370](https://github.com/sourcebot-dev/sourcebot/pull/376)
- Makes base retry indexing configuration configurable and move from a default of `5s` to `60s`. [#377](https://github.com/sourcebot-dev/sourcebot/pull/377)
- Fixed issue where files would sometimes never load in the code browser. [#365](https://github.com/sourcebot-dev/sourcebot/pull/365)

Expand Down
7 changes: 5 additions & 2 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"group": "Configuration",
"pages": [
{
"group": "Connecting your code",
"group": "Indexing your code",
"pages": [
"docs/connections/overview",
"docs/connections/github",
Expand All @@ -72,7 +72,10 @@
"group": "Authentication",
"pages": [
"docs/configuration/auth/overview",
"docs/configuration/auth/roles-and-permissions"
"docs/configuration/auth/providers",
"docs/configuration/auth/inviting-members",
"docs/configuration/auth/roles-and-permissions",
"docs/configuration/auth/faq"
]
},
"docs/configuration/transactional-emails",
Expand Down
1 change: 0 additions & 1 deletion docs/docs/configuration/audit-logs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ curl --request GET '$SOURCEBOT_URL/api/ee/audit' \
| `user.join_requested` | `user` | `org` |
| `user.join_request_approve_failed` | `user` | `account_join_request` |
| `user.join_request_approved` | `user` | `account_join_request` |
| `user.join_request_removed` | `user` | `account_join_request` |
| `user.invite_failed` | `user` | `org` |
| `user.invites_created` | `user` | `org` |
| `user.invite_accept_failed` | `user` | `invite` |
Expand Down
46 changes: 46 additions & 0 deletions docs/docs/configuration/auth/faq.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: FAQ
---

This page covers a range of frequently asked questions about Sourcebot's built-in authentication system.

<AccordionGroup>
<Accordion title="Can I disable the authentication system?">
No, at this time it's not possible to disable the authentication system. If this is preventing you from deploying Sourcebot
within your organization please [reach out](https://www.sourcebot.dev/contact)
</Accordion>

<Accordion title="I don't want to restrict access to my Sourcebot deployment, what should I do?">
Every user must register an account within your Sourcebot deployment. However, this dosn't mean their access
is restricted.

Unless member approval is required, anyone can sign up for an account on your deployment and immediately be granted access.
</Accordion>

<Accordion title="Does any data related to authentication (emails, passwords, etc) leave my deployment?">
**No data related to authentication (or your code) leaves your deployment**. Authentication is handled
purely by your deployment and the authentication providers you configure.

This data does not leave your device and is stored within in the database managed by your deployment. If you're
using credential login, passwords are encrypted at rest and in transit.
</Accordion>

<Accordion title="I'm deploying Sourcebot behind an identity proxy, do I still need to create an account in Sourcebot?">
<Note>Please note that IAP bridges are an enterprise feature</Note>
Sourcebot supports connecting your identity proxy directly into the built-in auth system using an IAP bridge. This allows Sourcebot to
register and authenticate automatically on a successful identity proxy log in.

Sourcebot currently supports [GCP IAP](/docs/configuration/auth/providers#gcp-iap). If you're using a different IAP
and require support, please [reach out](https://www.sourcebot.dev/contact)
</Accordion>

<Accordion title="How does Sourcebot implement authentication?">
Sourcebot uses [Auth.js](https://authjs.dev/) as its underlying authentication framework. Auth.js provides authentication providers
(credientials, Google, GitHub, etc) and an interface to enable user registration and log in. Internally, Auth.js uses JWT to provide
Sourcebot secure and reliable information about user authentication.
</Accordion>
</AccordionGroup>


Have a question that's not answered here? Submit it on our [GitHub discussions](https://github.com/sourcebot-dev/sourcebot/discussions)
page and we'll get back to you as soon as we can!
30 changes: 30 additions & 0 deletions docs/docs/configuration/auth/inviting-members.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: Inviting Members
sidebarTitle: Inviting members
---

There are various ways to configure how members can join a Sourcebot deployment.

## Member Approval

**By default, Sourcebot requires new members to be approved by the owner of the deployment**. This section explains how approvals work and how
to configure this behavior.

### Configuration
Member approval can be configured by the owner of the deployment by navigating to **Settings -> Members**:

![Member Approval Toggle](/images/member_approval_toggle.png)

### Managing Requests

If member approval is enabled, new members will be asked to submit a join request after signing up. They will not have access to the Sourcebot deployment
until this request is approved by the owner.

The owner can see and manage all pending join requests by navigating to **Settings -> Members**.

## Invite link

If member approval is required, an owner of the deployment can enable an invite link. When enabled, users
can use this invite link to register and be automatically added to the organization without approval:

![Invite Link Toggle](/images/invite_link_toggle.png)
133 changes: 16 additions & 117 deletions docs/docs/configuration/auth/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,124 +4,23 @@ title: Overview

<Warning>If you're deploying Sourcebot behind a domain, you must set the [AUTH_URL](/docs/configuration/environment-variables) environment variable.</Warning>

Sourcebot has built-in authentication that gates access to your organization. OAuth, email codes, and email / password are supported.
Sourcebot's built-in authentication system gates your deployment, and allows administrators to manage users and their permissions.

<CardGroup cols={2}>
<Card horizontal title="Authentication providers" icon="lock" href="/docs/configuration/auth/providers">
Configure additional authentication providers for your deployment.
</Card>
<Card horizontal title="Inviting members" icon="user" href="/docs/configuration/auth/inviting-members">
Learn how to configure how members join your deployment.
</Card>
<Card horizontal title="Roles and permissions" icon="shield" href="/docs/configuration/auth/roles-and-permissions">
Learn more about the different roles and permissions in Sourcebot.
</Card>
<Card horizontal title="FAQ" icon="question" href="/docs/configuration/auth/faq">
Have a question about Sourcebot's auth system? We might have the answers here.
</Card>
</CardGroup>

The first account that's registered on a Sourcebot deployment is made the owner. All other users who register must be [approved](/docs/configuration/auth/overview#approving-new-members) by the owner.

![Login Page](/images/login.png)


# Approving New Members

All account registrations after the first account must be approved by the owner. The owner can see all join requests by going into **Settings -> Members**.

If you have an [enterprise license](/docs/license-key), you can enable [AUTH_EE_ENABLE_JIT_PROVISIONING](/docs/configuration/auth/overview#enterprise-authentication-providers) to
have Sourcebot accounts automatically created and approved on registration.

You can setup emails to be sent when new join requests are created/approved by configurating [transactional emails](/docs/configuration/transactional-emails)
# Authentication Providers

To enable an authentication provider in Sourcebot, configure the required environment variables for the provider. Under the hood, Sourcebot uses Auth.js which supports [many providers](https://authjs.dev/getting-started/authentication/oauth). Submit a [feature request on GitHub](https://github.com/sourcebot-dev/sourcebot/discussions/categories/ideas) if you want us to add support for a specific provider.

## Core Authentication Providers

### Email / Password
---
Email / password authentication is enabled by default. It can be **disabled** by setting `AUTH_CREDENTIALS_LOGIN_ENABLED` to `false`.

### Email codes
---
Email codes are 6 digit codes sent to a provided email. Email codes are enabled when transactional emails are configured using the following environment variables:

- `AUTH_EMAIL_CODE_LOGIN_ENABLED`
- `SMTP_CONNECTION_URL`
- `EMAIL_FROM_ADDRESS`


See [transactional emails](/docs/configuration/transactional-emails) for more details.

## Enterprise Authentication Providers

The following authentication providers require an [enterprise license](/docs/license-key) to be enabled.

By default, a new user registering using these providers must have their join request accepted by the owner of the organization to join. To allow a user to join automatically when
they register for the first time, set the `AUTH_EE_ENABLE_JIT_PROVISIONING` environment variable to `true`.

### GitHub
---

[Auth.js GitHub Provider Docs](https://authjs.dev/getting-started/providers/github)

**Required environment variables:**
- `AUTH_EE_GITHUB_CLIENT_ID`
- `AUTH_EE_GITHUB_CLIENT_SECRET`

Optional environment variables:
- `AUTH_EE_GITHUB_BASE_URL` - Base URL for GitHub Enterprise (defaults to https://github.com)

### GitLab
---

[Auth.js GitLab Provider Docs](https://authjs.dev/getting-started/providers/gitlab)

**Required environment variables:**
- `AUTH_EE_GITLAB_CLIENT_ID`
- `AUTH_EE_GITLAB_CLIENT_SECRET`

Optional environment variables:
- `AUTH_EE_GITLAB_BASE_URL` - Base URL for GitLab instance (defaults to https://gitlab.com)

### Google
---

[Auth.js Google Provider Docs](https://authjs.dev/getting-started/providers/google)

**Required environment variables:**
- `AUTH_EE_GOOGLE_CLIENT_ID`
- `AUTH_EE_GOOGLE_CLIENT_SECRET`

### GCP IAP
---

<Note>If you're running Sourcebot in an environment that blocks egress, make sure you allow the [IAP IP ranges](https://www.gstatic.com/ipranges/goog.json)</Note>

Custom provider built to enable automatic Sourcebot account registration/login when using GCP IAP.

**Required environment variables**
- `AUTH_EE_GCP_IAP_ENABLED`
- `AUTH_EE_GCP_IAP_AUDIENCE`
- This can be found by selecting the ⋮ icon next to the IAP-enabled backend service and pressing `Get JWT audience code`

### Okta
---

[Auth.js Okta Provider Docs](https://authjs.dev/getting-started/providers/okta)

**Required environment variables:**
- `AUTH_EE_OKTA_CLIENT_ID`
- `AUTH_EE_OKTA_CLIENT_SECRET`
- `AUTH_EE_OKTA_ISSUER`

### Keycloak
---

[Auth.js Keycloak Provider Docs](https://authjs.dev/getting-started/providers/keycloak)

**Required environment variables:**
- `AUTH_EE_KEYCLOAK_CLIENT_ID`
- `AUTH_EE_KEYCLOAK_CLIENT_SECRET`
- `AUTH_EE_KEYCLOAK_ISSUER`

### Microsoft Entra ID

[Auth.js Microsoft Entra ID Provider Docs](https://authjs.dev/getting-started/providers/microsoft-entra-id)

**Required environment variables:**
- `AUTH_EE_MICROSOFT_ENTRA_ID_CLIENT_ID`
- `AUTH_EE_MICROSOFT_ENTRA_ID_CLIENT_SECRET`
- `AUTH_EE_MICROSOFT_ENTRA_ID_ISSUER`

---

# Troubleshooting

Expand Down
105 changes: 105 additions & 0 deletions docs/docs/configuration/auth/providers.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
title: Providers
---

Sourcebot supports a wide range of different authentication providers through it's integration with [Auth.js](https://authjs.dev/). This page
highlights how to configure the various supported providers.

If theres an authentication provider you'd like us to support, please [reach out](https://www.sourcebot.dev/contact).

# Core Authentication Providers

### Email / Password
---
Email / password authentication is enabled by default. It can be **disabled** by setting `AUTH_CREDENTIALS_LOGIN_ENABLED` to `false`.

### Email codes
---
Email codes are 6 digit codes sent to a provided email. Email codes are enabled when transactional emails are configured using the following environment variables:

- `AUTH_EMAIL_CODE_LOGIN_ENABLED`
- `SMTP_CONNECTION_URL`
- `EMAIL_FROM_ADDRESS`


See [transactional emails](/docs/configuration/transactional-emails) for more details.

# Enterprise Authentication Providers

The following authentication providers require an [enterprise license](/docs/license-key) to be enabled.

### GitHub
---

[Auth.js GitHub Provider Docs](https://authjs.dev/getting-started/providers/github)

**Required environment variables:**
- `AUTH_EE_GITHUB_CLIENT_ID`
- `AUTH_EE_GITHUB_CLIENT_SECRET`

Optional environment variables:
- `AUTH_EE_GITHUB_BASE_URL` - Base URL for GitHub Enterprise (defaults to https://github.com)

### GitLab
---

[Auth.js GitLab Provider Docs](https://authjs.dev/getting-started/providers/gitlab)

**Required environment variables:**
- `AUTH_EE_GITLAB_CLIENT_ID`
- `AUTH_EE_GITLAB_CLIENT_SECRET`

Optional environment variables:
- `AUTH_EE_GITLAB_BASE_URL` - Base URL for GitLab instance (defaults to https://gitlab.com)

### Google
---

[Auth.js Google Provider Docs](https://authjs.dev/getting-started/providers/google)

**Required environment variables:**
- `AUTH_EE_GOOGLE_CLIENT_ID`
- `AUTH_EE_GOOGLE_CLIENT_SECRET`

### GCP IAP
---

<Note>If you're running Sourcebot in an environment that blocks egress, make sure you allow the [IAP IP ranges](https://www.gstatic.com/ipranges/goog.json)</Note>

Custom provider built to enable automatic Sourcebot account registration/login when using GCP IAP.

**Required environment variables**
- `AUTH_EE_GCP_IAP_ENABLED`
- `AUTH_EE_GCP_IAP_AUDIENCE`
- This can be found by selecting the ⋮ icon next to the IAP-enabled backend service and pressing `Get JWT audience code`

### Okta
---

[Auth.js Okta Provider Docs](https://authjs.dev/getting-started/providers/okta)

**Required environment variables:**
- `AUTH_EE_OKTA_CLIENT_ID`
- `AUTH_EE_OKTA_CLIENT_SECRET`
- `AUTH_EE_OKTA_ISSUER`

### Keycloak
---

[Auth.js Keycloak Provider Docs](https://authjs.dev/getting-started/providers/keycloak)

**Required environment variables:**
- `AUTH_EE_KEYCLOAK_CLIENT_ID`
- `AUTH_EE_KEYCLOAK_CLIENT_SECRET`
- `AUTH_EE_KEYCLOAK_ISSUER`

### Microsoft Entra ID

[Auth.js Microsoft Entra ID Provider Docs](https://authjs.dev/getting-started/providers/microsoft-entra-id)

**Required environment variables:**
- `AUTH_EE_MICROSOFT_ENTRA_ID_CLIENT_ID`
- `AUTH_EE_MICROSOFT_ENTRA_ID_CLIENT_SECRET`
- `AUTH_EE_MICROSOFT_ENTRA_ID_ISSUER`

---
1 change: 0 additions & 1 deletion docs/docs/configuration/environment-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ The following environment variables allow you to configure your Sourcebot deploy
| Variable | Default | Description |
| :------- | :------ | :---------- |
| `SOURCEBOT_EE_AUDIT_LOGGING_ENABLED` | `true` | <p>Enables/disables audit logging</p> |
| `AUTH_EE_ENABLE_JIT_PROVISIONING` | `false` | <p>Enables/disables just-in-time user provisioning for SSO providers.</p> |
| `AUTH_EE_GITHUB_BASE_URL` | `https://github.com` | <p>The base URL for GitHub Enterprise SSO authentication.</p> |
| `AUTH_EE_GITHUB_CLIENT_ID` | `-` | <p>The client ID for GitHub Enterprise SSO authentication.</p> |
| `AUTH_EE_GITHUB_CLIENT_SECRET` | `-` | <p>The client secret for GitHub Enterprise SSO authentication.</p> |
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/connections/local-repos.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ icon: folder

import GenericGitHost from '/snippets/schemas/v3/genericGitHost.schema.mdx'

Sourcebot can sync code from generic git repositories stored in a local directory. This can be helpful in scenarios where you already have a large number of repos already checked out. Local repositories are treated as **read-only**, meaing Sourcebot will **not** `git fetch` new revisions.
Sourcebot can sync code from generic git repositories stored in a local directory. This can be helpful in scenarios where you already have a large number of repos already checked out. Local repositories are treated as **read-only**, meaning Sourcebot will **not** `git fetch` new revisions.

## Getting Started

Expand Down
Loading