Set Up Google Directory
In this guide, you will configure Google as an identity provider for Guardrails. Unlike the other directory types which use SAML, Google authentication uses OAuth 2.0. Users sign in with their Google Workspace accounts, and Guardrails restricts access to a specific hosted domain, so only members of your organization can authenticate.
This is a three-step process: create an OAuth client in Google Cloud, create the directory in Guardrails, then finish configuration in Google Cloud with the callback URL.
Prerequisites
- Signed in to Guardrails with
Turbot/Ownerpermissions at the Turbot (root) level. - Access to the Google Cloud console for a GCP project in your organization.
Step 1: Create an OAuth Client in Google Cloud
-
Sign in to the Google Cloud Console.
-
Navigate to APIs & Services > Credentials.
-
Click Create Credentials > OAuth client ID.
-
Select Web application as the application type.
-
Enter a name for the client (for example,
Turbot Guardrails). -
Leave Authorized JavaScript origins and Authorized redirect URIs empty for now. You'll add these after creating the directory in Guardrails.
-
Click Create.
-
Copy the Client ID and Client Secret. You'll need both when configuring the directory in Guardrails.
Step 2: Create the Google Directory in Guardrails
-
Navigate to Workspace > Directories.
-
Click Create Directory and select Google.
-
Fill in the directory details:
| Field | Description |
|---|---|
| Title | Displayed on the login screen. Example: Acme Corp Google. |
| Description | Optional. A note about the directory's purpose. |
| Hosted Domain | Your Google Workspace domain (e.g., acme.com). Guardrails restricts login to this domain only. |
| Client ID | The OAuth client ID from step 1. |
| Client Secret | The OAuth client secret from step 1. |
| Profile ID Template | Template for generating profile IDs. The default {{profile.email}} works for most cases. This cannot be changed after creation. |
-
Click Create.
-
The directory appears in the list with a New status. Click the directory to open its detail view, and copy the Callback URL. You'll need this for the next step.
Step 3: Complete Configuration in Google Cloud
-
Go back to the Google Cloud Console and open the OAuth client you created in step 1.
-
Under Authorized JavaScript origins, click Add URI and enter your Guardrails console URL (e.g.,
https://your-workspace.cloud.turbot.com). -
Under Authorized redirect URIs, click Add URI and paste the Callback URL you copied from the Guardrails directory.
-
Click Save.
Step 4: Activate and Test
-
Back in Guardrails, navigate to Workspace > Directories.
-
Click the Activate action on the new Google directory.
-
Open an incognito or private browser window.
-
Navigate to your Guardrails workspace URL.
-
Select the new Google directory from the login dropdown and sign in with a Google Workspace account from the configured domain.
-
After signing in, a new profile is created automatically. The user has no permissions until an administrator grants them.
Troubleshooting
| Issue | Solution |
|---|---|
| Login fails with a redirect error | Verify the Authorized redirect URI in Google Cloud matches the Callback URL from the Guardrails directory exactly, including the protocol and trailing path. |
| Directory doesn't appear on the login screen | Confirm the directory is Active on the Workspace > Directories page. |
| Users from outside the domain can't sign in | This is expected. The Hosted Domain setting restricts authentication to the specified domain. |
| Profile fields are empty after login | Verify the Google Workspace account has a first name, last name, and email configured. |
Next Steps
- Grant a Permission: Give new users access after their first login.
- Profiles: Understand how profiles are created and managed.