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_ENABLEDSMTP_CONNECTION_URLEMAIL_FROM_ADDRESS
Enterprise Authentication Providers
The following authentication providers require an enterprise license to be enabled.GitHub
Auth.js GitHub Provider Docs Authentication using both a GitHub OAuth App and a GitHub App is supported. In both cases, you must provide Sourcebot the
CLIENT_ID and SECRET_ID and configure the
callback URL correctly (more info in Auth.js docs).
When using a GitHub App for auth, enable the following permissions:
“Email addresses” account permissions (read)"Metadata" repository permissions (read)(only needed if enabling permission syncing)
AUTH_EE_GITHUB_CLIENT_IDAUTH_EE_GITHUB_CLIENT_SECRET
AUTH_EE_GITHUB_BASE_URL- Base URL for GitHub Enterprise (defaults to https://github.com)
GitLab
Auth.js GitLab Provider Docs Authentication using GitLab is supported via a OAuth2.0 app installed on the GitLab instance. Follow the instructions in the GitLab docs to create an app. The callback URL should be configurd to
<sourcebot_deployment_url>/api/auth/callback/gitlab, and the following scopes need to be set:
| Scope | Required | Notes |
|---|---|---|
| read_user | Yes | Allows Sourcebot to read basic user information required for authentication. |
| read_api | Conditional | Required only when permission syncing is enabled. Enables Sourcebot to list all repositories and projects for the authenticated user. |
AUTH_EE_GITLAB_CLIENT_IDAUTH_EE_GITLAB_CLIENT_SECRET
AUTH_EE_GITLAB_BASE_URL- Base URL for GitLab instance (defaults to https://gitlab.com)
Auth.js Google Provider Docs Required environment variables:
AUTH_EE_GOOGLE_CLIENT_IDAUTH_EE_GOOGLE_CLIENT_SECRET
GCP IAP
If you’re running Sourcebot in an environment that blocks egress, make sure you allow the IAP IP ranges
AUTH_EE_GCP_IAP_ENABLEDAUTH_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
- This can be found by selecting the ⋮ icon next to the IAP-enabled backend service and pressing
Okta
Auth.js Okta Provider Docs Required environment variables:
AUTH_EE_OKTA_CLIENT_IDAUTH_EE_OKTA_CLIENT_SECRETAUTH_EE_OKTA_ISSUER
Keycloak
Auth.js Keycloak Provider Docs Required environment variables:
AUTH_EE_KEYCLOAK_CLIENT_IDAUTH_EE_KEYCLOAK_CLIENT_SECRETAUTH_EE_KEYCLOAK_ISSUER
Microsoft Entra ID
Auth.js Microsoft Entra ID Provider Docs Required environment variables:AUTH_EE_MICROSOFT_ENTRA_ID_CLIENT_IDAUTH_EE_MICROSOFT_ENTRA_ID_CLIENT_SECRETAUTH_EE_MICROSOFT_ENTRA_ID_ISSUER

