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,profileandemail.
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
BuildBuddyfor application name. - Select the account types in Azure AD that should have access to BuildBuddy.
Usually
Accounts in this organizational directory onlyis 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/withWebplatform. - Click
Register - Take note of
Application (client) IDandDirectory (tenant) ID.
-
Configure Application Secret
- Click on
Certificates & secrets->Client secrets->New client secretWe recommend set the expiry date of the secret to 12 months. - Click
Add-> Take note of theValueof 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
BuildBuddyand 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 Statementto mapemailand valueuser.email. -
Click
Finish. -
Under
Metadata URLclick 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
BuildBuddyfor the name and hitCreate. -
In the newly created application view, navigate to
Single sign-onand selectSAML. -
Click on
Editin the first sectionBasic SAML Configuration.a.
Identifier (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 URLshould behttps://app.buildbuddy.io/login?slug=<org-slug>.d. Hit
Savebutton. -
Click on
Editin the second sectionAttributes & Claims.a. Select
Add new claim.b. For
Name, fill inemail.c. For
SourceselectAttributeand forSource attribute, search and selectuser.mail.d. Hit the
Savebutton. -
In the 3rd section
SAML Certificates, copy theApp Federation Metadata Urland 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
emailattribute 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 Editorpage in Okta. -
Select the
User (default)profile. -
Add a new attribute with the following settings:
Display name:
BuildBuddy roleVariable name:
buildBuddyRole
-
-
Within Okta, open the BuildBuddy application that was created for SAML integration.
-
Edit the
App Settingson theGeneral Page, enableSCIM provisioningand Save. -
Go to the
Provisioningtab, clickEditand 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 UsersandPush Profile Updates. -
For
Authentication Mode, selectHTTP Headerand enter the previously created API key as theToken. -
Click
Save
-
-
On the
Provisioningtab, clickEditnext toProvisioning to App.-
Enable
Create Users,Update User AttributesandDeactivate Users. -
Click
Save.
-
-
Under
Attribute Mappingsperform the following changes:-
Delete all mappings except
userName,givenNameandfamilyName. -
Click
Go to Profile Editor, clickAdd Attributeand create an attribute with the following details:Display name:
RoleVariable name:
roleExternal name:
roleExternal namespace:
urn:ietf:params:scim:schemas:core:2.0:User
-
-
Navigate back to the
Provisioningpage. -
Under
Attribute Mappingsdo the following:-
Click
Show Unmapped Attributes -
Find the
Roleattribute and click the edit icon. -
Under
Attribute valueselectMap from Okta Profileand choosebuildBuddyRoleas the source attribute. -
For
Apply on, selectCreate and update -
Click
Saveto 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
Provisioningpage. -
Under the
Managesection of side-bar, selectProvisioning. -
Change
Provisioning ModetoAutomatic. -
Under
Admin Credentials, enter the following information:-
Tenant URL:
https://app.buildbuddy.io/scim -
Secret Token: Enter the value of the
Org admin keythat was created earlier. -
Press
Save
-
-
After pressing
Savein the previous step, you should see a newMappingssection. Under that section do the following:-
Open
Provision Microsoft Entra ID Groupsand setEnabledto No as BuildBuddy does not support syncing groups. Save and return to the previous page. -
Open
Provision Microsoft Entra ID Usersand make the following changes:-
Delete all mappings except
userName,active,name.givenNameandname.familyName -
Ensure the
userNamemapping matches the attribute that was configured for SAML login.e.g. If SAML claims were configured to use
user.mailthen theuserNamemapping should also be set touser.mail. -
Add an attribute for the application role:
Type:
expressionExpression:
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 registrationspage. -
Click on the
BuildBuddyapplication (you may need to selectAll applicationsto see it) -
Go to the
App rolespage. -
Delete the
Usersrole. -
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.
-