Auth Configuration
Auth is only configurable in the Enterprise version of BuildBuddy.
OIDC
Section
auth:
The Auth section enables BuildBuddy authentication using an OpenID Connect provider that you specify. Optional
Options
oauth_providers:
A list of configured OAuth Providers.issuer_url:
The issuer URL of this OIDC Provider.client_id:
The oauth client ID.client_secret:
The oauth client secret.
enable_anonymous_usage:
If true, unauthenticated build uploads will still be allowed but won't be associated with your organization.
Redirect URL
If during your OpenID provider configuration you're asked to enter a Redirect URL, you should enter https://YOUR_BUILDBUDDY_URL/auth/
. For example if your BuildBuddy instance was hosted on https://buildbuddy.acme.com
, you'd enter https://buildbuddy.acme.com/auth/
as your redirect url.
OIDC Examples
Google auth provider
If you'd like to use Google as an auth provider, you can easily obtain your client id and client secret here.
Example:
auth:
oauth_providers:
- issuer_url: "https://accounts.google.com"
client_id: "12345678911-f1r0phjnhbabcdefm32etnia21keeg31.apps.googleusercontent.com"
client_secret: "sEcRetKeYgOeShErE"
Gitlab auth provider
You can use Gitlab as an OIDC identity provider for BuildBuddy. This feature is available for both Gitlab On-Prem Deployment and Gitlab SaaS offering.
For more details, please refer to Gitlab's latest Official Documentation
Note: Because Gitlab has yet to support refresh tokens, you need to configure BuildBuddy to not request the offline_access
scope from Gitlab:
auth:
disable_refresh_token: true
Configuration:
- First, register a Gitlab Application:
- For Gitlab SaaS, follow Group-Owned Application Documentation instructions.
- For Gitlab On-Prem, follow Instance-Wide Application Documentation instructions.
- The Redirect URL should be
https://YOUR_BUILDBUDDY_URL/auth/
, pointing to your existing BuildBuddy deployment. - The scopes needed are
openid
,profile
andemail
.
Once the Gitlab application is created, you can configure it as a BuildBuddy auth provider like so:
auth:
oauth_providers:
- issuer_url: "https://gitlab.com"
client_id: "<GITLAB APPLICATION ID>"
client_secret: "<GITLAB APPLICATION SECRET>"
Azure AD provider
-
Navigate to the Azure Portal. If there are multiple Azure AD tenants available, select the tenant that will be using BuildBuddy.
-
Register a BuildBuddy application:
- Search for and select Azure Active Directory
- Under
Manage
, selectApp registration
->New registration
- Enter
BuildBuddy
for application name. - Select the account types in Azure AD that should have access to BuildBuddy.
Usually
Accounts in this organizational directory only
is correct for the single-tenant use case, "Accounts in any organizational directory" is correct for the multi-tenant use case. - Redirect URI should be
https://YOUR_BUILDBUDDY_URL/auth/
withWeb
platform. - Click
Register
- Take note of
Application (client) ID
andDirectory (tenant) ID
.
-
Configure Application Secret
- Click on
Certificates & secrets
->Client secrets
->New client secret
We recommend set the expiry date of the secret to 12 months. - Click
Add
-> Take note of theValue
of the newly created secret.
- Click on
-
Configure Application API scope
- Navigate to
API permissions
- Select
Add a permission
->Microsoft Graph
->Delegated permission
- In
OpenId permissions
, selectemail
,offline_access
,openid
,profile
. - In
User
, selectUser.Read
- Click
Add permissions
- Navigate to
-
After that, your BuildBuddy config should be like this
auth:
oauth_providers:
- issuer_url: "https://login.microsoftonline.com/<DIRECTORY_ID>/v2.0"
client_id: "<CLIENT_ID>"
client_secret: "<CLIENT_SECRET>"
SAML 2.0
SAML 2.0 authentication is avaliable for BuildBuddy Cloud (SaaS).
Okta SAML provider
-
Find your organization's short name (slug) in your BuildBuddy Organization Settings and replace instances of
<org-slug>
below with this value. -
On the Okta Applications page, click
Create App Integration
, selectSAML 2.0
. -
Enter
BuildBuddy
and hitNext
. -
Enter the following fields under General, making sure to replace
<org-slug>
with the value froms step 1:a. For Single sign on URL enter:
https://app.buildbuddy.io/auth/saml/acs?slug=<org-slug>
b. For Audience URI (SP Entity ID) enter:
https://app.buildbuddy.io/saml/metadata?slug=<org-slug>
-
Add an
Attribute Statement
to mapemail
and valueuser.email
. -
Click
Finish
. -
Under
Metadata URL
click copy and share this URL (which should have the formathttps://xxxx.okta.com/app/XXXX/sso/saml/metadata
) with BuildBuddy support.
Azure AD / Entra SAML provider
-
Find your organization's short name (slug) in your BuildBuddy Organization Settings and replace instances of
<org-slug>
below with this value. -
Visit the Entra portal page, navigate to
Applications
->Enterprise applications
. -
Click
New application
. -
Click
Create your own application
. -
Enter
BuildBuddy
for the name and hitCreate
. -
In the newly created appliction view, navigate to
Single sign-on
and selectSAML
. -
Click on
Edit
in the first sectionBasic SAML Configuration
.a.
Identified (Entity ID)
should behttps://app.buildbuddy.io/saml/metadata?slug=<org-slug>
.b.
Reply URL (Assertion Consumer Service URL)
should behttps://app.buildbuddy.io/auth/saml/acs?slug=<org-slug>
.c.
Sign on URL
should behttps://app.buildbuddy.io/login?slug=<org-slug>
.d. Hit
Save
button. -
Click on
Edit
in the second sectionAttributes & Claims
.a. Select
Add new claim
.b. For
Name
, fill inemail
.c. For
Source
selectAttribute
and forSource attribute
, search and selectuser.mail
.d. Hit the
Save
button. -
In the 3rd section
SAML Certificates
, copy theApp Federation Metadata Url
and share it with BuildBuddy support.
Other providers
-
Find the short name (slug) for your organization in your BuildBuddy Organization Settings.
-
Assertion Consumer Service (ACS) URL:
https://app.buildbuddy.io/auth/saml/acs?slug=<org-slug>
-
Audience URL (SP Entity ID):
https://app.buildbuddy.io/saml/metadata?slug=<org-slug>
-
Make sure the
email
attribute is mapped touser.email
(or equivalent).
Once the app is created, share the Identity Provider Metadata URL with BuildBuddy support.
User management via SCIM
Users can be provisioned and deprovisioned within BuildBuddy by external auth providers using the SCIM API.
First, create an API key that will be used for managing users on the organization settings page. Select "Org admin key" as the key type.
Okta
-
First, we will add a custom User attribute that will determine the role of the synced user.
-
Open the
Profile Editor
page in Okta. -
Select the
User (default)
profile. -
Add a new attribute with the following settings:
Display name:
BuildBuddy role
Variable name:
buildBuddyRole
-
-
Within Okta, open the BuildBuddy application that was created for SAML integration.
-
Edit the
App Settings
on theGeneral Page
, enableSCIM provisioning
and Save. -
Go to the
Provisioning
tab, clickEdit
and make the following changes:-
For
SCIM connector base URL
, enterhttps://app.buildbuddy.io/scim
-
For
Unique identifier field for users
, enteruserName
. -
Under
Supported provisioning actions
, enableImport New Users and Profile Updates
,Push New Users
andPush Profile Updates
. -
For
Authentication Mode
, selectHTTP Header
and enter the previously created API key as theToken
. -
Click
Save
-
-
On the
Provisioning
tab, clickEdit
next toProvisioning to App
.-
Enable
Create Users
,Update User Attributes
andDeactivate Users
. -
Click
Save
.
-
-
Under
Attribute Mappings
perform the following changes:-
Delete all mappings except
userName
,givenName
andfamilyName
. -
Click
Go to Profile Editor
, clickAdd Attribute
and create an attribute with the following details:Display name:
Role
Variable name:
role
External name:
role
External namespace:
urn:ietf:params:scim:schemas:core:2.0:User
-
-
Navigate back to the
Provisioning
page. -
Under
Attribute Mappings
do the following:-
Click
Show Unmapped Attributes
-
Find the
Role
attribute and click the edit icon. -
Under
Attribute value
selectMap from Okta Profile
and choosebuildBuddyRole
as the source attribute. -
For
Apply on
, selectCreate and update
-
Click
Save
to finish adding the attribute.
-
By default, users that do not have the attribute field set will be created with the developer
role.
You can modify the attribute value in Okta if you wish to grant them a different role.
Azure AD / Entra
-
Within Entra, open the BuildBuddy application that was created for SAML integration.
-
Go to the
Provisioning
page. -
Under the
Manage
section of side-bar, selectProvisioning
. -
Change
Provisioning Mode
toAutomatic
. -
Under
Admin Credentials
, enter the following information:-
Tenant URL:
https://app.buildbuddy.io/scim
-
Secret Token: Enter the value of the
Org admin key
that was created earlier. -
Press
Save
-
-
After pressing
Save
in the previous step, you should see a newMappings
section. Under that section do the following:-
Open
Provision Microsoft Entra ID Groups
and setEnabled
to No as BuildBuddy does not support syncing groups. Save and return to the previous page. -
Open
Provision Microsoft Entra ID Users
and make the following changes:-
Delete all mappings except
userName
,active
,name.givenName
andname.familyName
-
Ensure the
userName
mapping matches the attribute that was configured for SAML login.e.g. If SAML claims were configured to use
user.mail
then theuserName
mapping should also be set touser.mail
. -
Add an attribute for the application role:
Type:
expression
Expression:
SingleAppRoleAssignment([appRoleAssignments])
Target attribute:
roles[primary eq "True"].value
-
-
-
The last step is to configure the BuildBuddy specific roles:
-
From the main Entra page, open the
App registrations
page. -
Click on the
BuildBuddy
application (you may need to selectAll applications
to see it) -
Go to the
App roles
page. -
Delete the
Users
role. -
Create a role for each BuildBuddy role to use.
The available roles are "admin", "developer", "writer", "reader".
The display name should exactly match one of the values listed above and the value can be anything.
When sending role information downstream, Entra only sends the role display name, ignoring the role value.
-