Google Cloud Integration
This page provides a comprehensive guide for integrating Google Cloud services with Timbr’s ontology-based semantic layer.
Timbr operates as a virtual knowledge graph over existing data sources, enabling the semantic layer to securely expose business entities, relationships, and logic across Google Cloud services, BI tools, and AI systems.
This includes configuring Google Cloud Single Sign-On (SSO) using OAuth 2.0 and OpenID Connect, enabling BigQuery token-based authentication for user-specific data access, and integrating with Google Analytics.
Table of Contents
Google Cloud Single Sign-On (SSO)
Configure Google Cloud as a Single Sign-On (SSO) provider for the Timbr platform using OAuth 2.0 and OpenID Connect.
Prerequisites
Before you begin, ensure you have:
- Administrative access to your Google Cloud Console
- Administrative access to the Timbr platform server to configure environment variables
- Your Timbr domain URL (e.g.,
https://timbr.example.com) - An HTTPS endpoint (Google Cloud SSO doesn't allow configuring HTTP servers)
- An existing SSL certificate configured for the Timbr Platform service
Step 1: Create a Google Cloud Project (if needed)
If you don't already have a Google Cloud project:
- Navigate to Google Cloud Console
- Click the project dropdown at the top of the page
- Click New Project
- Enter a project name (e.g., "Timbr Platform")
- Click Create
Step 2: Enable Required APIs
- In the Google Cloud Console, navigate to APIs & Services > Library
- Search for and enable the following APIs:
- Google+ API (for user profile information)
- People API (for user information access)
Step 3: Configure OAuth Consent Screen
- Navigate to APIs & Services > OAuth consent screen
- Select the User Type:
- Internal: For Google Workspace organizations (users within your domain only)
- External: For allowing any Google account
- Click Create
- Configure the consent screen:
- App name:
Timbr Platform(or your preferred name) - User support email: Select your email address
- App logo: (Optional) Upload your organization's logo
- Application home page:
https://<your-timbr-domain> - Authorized domains: Add your Timbr domain (e.g.,
timbr.example.com) - Developer contact information: Enter your email address
- App name:
- Click Save and Continue
Configure Scopes
- On the Scopes page, click Add or Remove Scopes
- Add the following scopes:
.../auth/userinfo.email- View your email address.../auth/userinfo.profile- See your personal infoopenid- Authenticate using OpenID Connect
- Click Update and then Save and Continue
Test Users (External Apps Only)
If you selected External user type and your app is in testing mode:
Click Add Users
Enter the email addresses of users who should have access during testing
Click Save and Continue
Review the summary and click Back to Dashboard
Step 4: Create OAuth 2.0 Credentials
- Navigate to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Select Application type: Web application
- Configure the following settings:
- Name:
Timbr Platform OAuth Client(or your preferred name) - Authorized JavaScript origins: (Optional) Add
https://<your-timbr-domain> - Authorized redirect URIs:
https://<your-timbr-domain>/oauth-authorized/google- Replace
<your-timbr-domain>with your actual Timbr domain
- Replace
- Name:
- Click Create
Step 5: Collect OAuth Client Credentials
After creating the OAuth client:
- A dialog will appear with your credentials
- Copy the Client ID - this will be your
OAUTH_CLIENT_ID - Copy the Client Secret - this will be your
OAUTH_SECRET - Click OK
Store your client secret securely. Never commit it to version control or share it publicly.
You can always view your OAuth credentials by clicking on the client name in the Credentials page.
Step 6: Configure Timbr Environment Variables
Add the Google OAuth environment variables to your timbr-platform service configuration.
Required Environment Variables
# Provider identifier
OAUTH_PROVIDER=google
# Client ID from Google Cloud Console
OAUTH_CLIENT_ID=<GOOGLE_CLOUD_CLIENT_ID>
# Client Secret from Google Cloud Console
OAUTH_SECRET=<GOOGLE_CLOUD_CLIENT_SECRET>
# BigQuery token authentication (set to false unless using BigQuery with user tokens)
USE_BIGQUERY_TOKEN=false
Set USE_BIGQUERY_TOKEN=true only if you're using BigQuery as a datasource and want to authenticate per user. See the BigQuery Token Authentication section for more details.
Deployment Options
Docker Compose
Add the OAuth environment variables to your timbr-platform service in docker-compose.yml:
services:
timbr-platform:
# ...
environment:
- OAUTH_PROVIDER=google
- OAUTH_CLIENT_ID=<GOOGLE_CLOUD_CLIENT_ID>
- OAUTH_SECRET=<GOOGLE_CLOUD_CLIENT_SECRET>
- USE_BIGQUERY_TOKEN=false
After updating your docker-compose.yml, restart the timbr-platform service:
sudo docker-compose up -d timbr-platform
Kubernetes
Add the OAuth environment variables to your timbr-platform Deployment manifest:
apiVersion: apps/v1
kind: Deployment
metadata:
name: timbr-platform
namespace: default
spec:
template:
spec:
containers:
- name: timbr-platform
# ...
env:
# ...
- name: OAUTH_PROVIDER
value: google
- name: OAUTH_CLIENT_ID
value: <GOOGLE_CLOUD_CLIENT_ID>
- name: OAUTH_SECRET
value: <GOOGLE_CLOUD_CLIENT_SECRET>
- name: USE_BIGQUERY_TOKEN
value: "false"
Apply the updated manifest:
kubectl apply -f timbr-platform.yaml
For better security in Kubernetes, store sensitive values like OAUTH_CLIENT_ID and OAUTH_SECRET in Kubernetes Secrets instead of plain text in the manifest:
- name: OAUTH_SECRET
valueFrom:
secretKeyRef:
name: google-oauth-secret
key: client-secret
Optional Environment Variables
# Enable user self-registration on first OAuth login (default: false)
AUTH_USER_REGISTRATION=true
# Default role for self-registered users (default: viewer)
AUTH_USER_REGISTRATION_ROLE=viewer
# Allow or disable username/password login alongside OAuth (default: true)
AUTH_WITH_USERPASS=true
# Default scheme for OAuth redirects (default: https)
OAUTH_DEFAULT_SCHEME=https
Step 7: Test the Integration
- Navigate to your Timbr platform URL (e.g.,
https://timbr.example.com) - You should see an option to Sign in with Google (or similar)
- Click the sign-in button
- Select your Google account and authorize the application
- Grant the requested permissions
- After successful authentication, you should be redirected back to the Timbr platform
If AUTH_USER_REGISTRATION=true, new users will be automatically created on their first login with the role specified in AUTH_USER_REGISTRATION_ROLE.
Troubleshooting
"Redirect URI mismatch" error:
- Verify the redirect URI in Google Cloud Console exactly matches:
https://<your-timbr-domain>/oauth-authorized/google - Ensure there are no trailing slashes or typos
- The domain must match exactly, including protocol (https)
"Access blocked: This app's request is invalid" error:
- Ensure the OAuth consent screen is properly configured
- Verify required scopes are added
- If using External user type in testing mode, ensure the user is added to test users
Users can't sign in:
- Check that the SSL certificate is valid and not expired
- Verify
OAUTH_PROVIDER=googleis set correctly - Ensure the client ID and secret are correct
- Check Timbr platform logs for specific error messages
BigQuery Token Authentication
Enable per-user authentication for Google BigQuery datasources, allowing users to query BigQuery with their own credentials and permissions.
Overview
When enabled, BigQuery token authentication allows:
- User-specific access: Each user queries BigQuery with their own Google Cloud credentials
- Fine-grained permissions: Users see only the data they have access to in BigQuery
- Audit trail: Track which users execute which queries
- No shared credentials: Eliminates the need for a shared service account
Prerequisites
- Google Cloud SSO must be configured (see section above)
- BigQuery API enabled in your Google Cloud project
- Users must have appropriate BigQuery permissions in Google Cloud
- Administrative access to Timbr platform configuration
Step 1: Enable BigQuery API
- In the Google Cloud Console, navigate to APIs & Services > Library
- Search for BigQuery API
- Click Enable (if not already enabled)
Step 2: Configure OAuth Scopes
When creating or editing your OAuth client (from the SSO setup):
Navigate to APIs & Services > OAuth consent screen
Click Edit App
On the Scopes page, add the following BigQuery-specific scope:
.../auth/bigquery- View and manage your data in Google BigQuery
Or for read-only access:
.../auth/bigquery.readonly- View data in Google BigQuery
Click Update and Save and Continue
Choose the appropriate scope based on your requirements:
- Use
.../auth/bigqueryif users need to create or modify BigQuery resources - Use
.../auth/bigquery.readonlyif users only need to read data
Step 3: Update Timbr Platform Configuration
Enable BigQuery token authentication by setting the environment variable:
USE_BIGQUERY_TOKEN=true
Deployment Options
Docker Compose
Update your timbr-platform service in docker-compose.yml:
services:
timbr-platform:
# ...
environment:
- OAUTH_PROVIDER=google
- OAUTH_CLIENT_ID=<GOOGLE_CLOUD_CLIENT_ID>
- OAUTH_SECRET=<GOOGLE_CLOUD_CLIENT_SECRET>
- USE_BIGQUERY_TOKEN=true # Changed from false to true
Restart the service:
sudo docker-compose up -d timbr-platform
Kubernetes
Update your timbr-platform Deployment manifest:
apiVersion: apps/v1
kind: Deployment
metadata:
name: timbr-platform
spec:
template:
spec:
containers:
- name: timbr-platform
# ...
env:
# ...
- name: USE_BIGQUERY_TOKEN
value: "true" # Changed from "false" to "true"
Apply the manifest:
kubectl apply -f timbr-platform.yaml
Step 4: Configure BigQuery Datasource in Timbr
Add or configure a BigQuery datasource in the Timbr platform:
Navigate to Datasources in the Timbr Platform
Click Add New Datasource (or edit an existing BigQuery datasource)
Configure with the following settings:
- Datasource Type:
BigQuery - Datasource Name:
bigquery(or your preferred name) - Project ID: Your Google Cloud project ID
- Dataset: (Optional) Default dataset name
- Authentication: The user's OAuth token will be used automatically
- Datasource Type:
Click Test Connection to verify the configuration
Click Save
How It Works
- User authenticates to Timbr using Google Cloud SSO
- Timbr obtains an OAuth token with BigQuery access scope
- When querying BigQuery, Timbr uses the user's token to authenticate
- BigQuery executes the query with the user's permissions
- Results are returned based on what the user has access to
Grant BigQuery Permissions to Users
To allow users to access specific BigQuery datasets and tables:
- In Google Cloud Console, navigate to BigQuery
- Select the dataset you want to grant access to
- Click Share > Permissions
- Click Add Principal
- Enter the user's email address
- Select an appropriate role:
- BigQuery Data Viewer: Read-only access to data
- BigQuery Data Editor: Read and write access to data
- BigQuery User: Can run queries and jobs
- Click Save
You can also grant permissions at the project level via IAM & Admin > IAM if you want users to have broader access.
Benefits
- Enhanced security: No shared credentials or service accounts
- Access control: Leverage existing Google Cloud IAM permissions
- Compliance: User actions are auditable through Google Cloud logs
- Simplified management: Manage access in one place (Google Cloud IAM)
Troubleshooting
"Permission denied" errors:
- Verify the user has appropriate BigQuery permissions in Google Cloud
- Check that the BigQuery API is enabled
- Ensure the OAuth scope includes BigQuery access
Token expiration:
- OAuth tokens expire after a certain period
- Users may need to re-authenticate by logging out and back in
- Consider implementing token refresh mechanisms if needed
Missing datasets or tables:
- Verify the user has been granted access to the specific datasets
- Check that the project ID is correct in the datasource configuration
Google Analytics Integration
Connect the Timbr Platform to Google Analytics to track user behavior and platform usage.
Prerequisites
- Google Analytics account
- Google Analytics tracking ID (e.g.,
G-XXXXXXXXXXorUA-XXXXXXXXX-X) - Administrative access to Timbr platform configuration
Step 1: Create Google Analytics Property (if needed)
If you don't already have a Google Analytics property:
- Sign in to Google Analytics
- Click Admin (gear icon in the lower left)
- In the Property column, click Create Property
- Enter property details:
- Property name:
Timbr Platform - Reporting time zone: Select your timezone
- Currency: Select your currency
- Property name:
- Click Next and complete the setup
- For web-based properties, create a Data Stream:
- Select Web
- Website URL: Your Timbr domain (e.g.,
https://timbr.example.com) - Stream name:
Timbr Platform
- Click Create stream
- Copy the Measurement ID (e.g.,
G-XXXXXXXXXX)
Step 2: Configure Timbr Platform
Add the Google Analytics tracking ID to your timbr-platform service:
GOOGLE_ANALYTICS_TAG=<YOUR_GOOGLE_ANALYTICS_TAG>
Deployment Options
Docker Compose
Add to your timbr-platform service in docker-compose.yml:
services:
timbr-platform:
# ...
environment:
# ... (existing configuration)
- GOOGLE_ANALYTICS_TAG=G-XXXXXXXXXX
Restart the service:
sudo docker-compose up -d timbr-platform
Kubernetes
Add to your timbr-platform Deployment manifest:
apiVersion: apps/v1
kind: Deployment
metadata:
name: timbr-platform
spec:
template:
spec:
containers:
- name: timbr-platform
# ...
env:
# ...
- name: GOOGLE_ANALYTICS_TAG
value: G-XXXXXXXXXX
Apply the manifest:
kubectl apply -f timbr-platform.yaml
Step 3: Verify Integration
- Navigate to your Timbr platform
- Perform some actions (page views, clicks, etc.)
- In Google Analytics, go to Reports > Realtime
- Verify that your activity is being tracked
It may take a few minutes for data to appear in Google Analytics. For detailed reports, wait 24-48 hours for data processing.
What Gets Tracked
By default, Google Analytics will track:
- Page views
- User sessions
- Geographic location
- Browser and device information
- User interactions (depending on your Timbr platform's analytics implementation)
Privacy Considerations
When implementing Google Analytics:
- Review your organization's privacy policy
- Inform users about data collection
- Consider implementing cookie consent mechanisms
- Review Google Analytics data retention settings
- Comply with GDPR, CCPA, and other privacy regulations
Ensure your use of Google Analytics complies with relevant data protection regulations in your jurisdiction.
Additional Resources
- Google Cloud OAuth 2.0 Documentation
- BigQuery Authentication Documentation
- Google Analytics Documentation
- Google Cloud IAM Documentation
Support
For additional assistance with Google Cloud integration, please contact Timbr support or refer to the main Timbr documentation.