Google SSO
Overview
KubeSense supports single sign-on (SSO) authentication through Google Workspace, enabling secure, passwordless access to your observability platform using your organization's Google credentials.
info: Google Workspace integration provides enterprise-grade authentication and security for accessing the KubeSense platform.
Prerequisites
Before setting up Google Workspace integration, ensure you have:
- Google Console account with Admin access
- KubeSense instance (self-hosted) with administrative access
- Your KubeSense instance URL (e.g.,
https://kubesense.example.com)
Step 1: Create OAuth 2.0 Credentials in Google Cloud
- Visit the Google Cloud Console → APIs & Services → Credentials
- Select or create a project for KubeSense
- Click Create credentials → OAuth client ID
- If prompted, configure the OAuth consent screen:
- Choose Internal (for Google Workspace users only)
- Fill in the required application information
- Add scopes (
openid,email,profile)
- Select Web application as the application type
- Add an Authorized redirect URI:
Replacehttps://<SELF_HOSTED_KUBESENSE_DOMAIN>/login<SELF_HOSTED_KUBESENSE_DOMAIN>with your actual KubeSense domain (e.g.,https://kubesense.example.com/login) - Click Create
- Note the Client ID. You'll need these for KubeSense configuration
note: You can add multiple redirect URIs for different environments (development, staging, production) by clicking Add URI.
Step 2: Configure KubeSense for Google Authentication
Once you have obtained the Google Client ID and Client Secret, update your KubeSense values file:
- Locate your KubeSense values file (typically
values.yamlor your Helm values file) - Find or create the
webapp:section - Add the Google authentication configuration:
webapp:
google_auth:
enabled: true
client_id: <GOOGLE_CLIENT_ID>Replace:
<GOOGLE_CLIENT_ID>with the Client ID from Google Cloud Console
Example Configuration
webapp:
google_auth:
enabled: true
client_id: 123456789-abcdefghijklmnop.apps.googleusercontent.com- Apply the configuration:
- If using Helm:
helm upgrade kubesense <chart> -f values.yaml - If using other deployment methods, follow your standard deployment process
- If using Helm:
note: Ensure that the redirect URI configured in Google Cloud Console exactly matches your KubeSense domain with /login path. Any mismatch will cause authentication to fail.
Step 3: Verify OAuth Consent Screen Configuration
For production deployments, ensure your OAuth consent screen is properly configured:
- Navigate to APIs & Services → OAuth consent screen in Google Cloud Console
- Verify the following:
- Application name: Your KubeSense application name
- User support email: Your support email address
- Authorized domains: Add your organization domain
- Scopes: Ensure
openid,email, andprofileare included
- For Internal apps: Only users in your Google Workspace can access
- For External apps: You may need to verify your app and add test users during development
Verifying Integration
After configuring Google Workspace integration:
-
Test SSO Flow:
- Navigate to your KubeSense URL
- Click on the sign-in button
- You should be redirected to Google sign-in page
- After successful authentication, you should be redirected back to KubeSense
-
Check User Profile:
- Verify that your user profile and email are correctly displayed in KubeSense
- Confirm that you have appropriate access permissions
-
Test Logout:
- Click logout from KubeSense
- Verify that the session is terminated properly
- Confirm that you're redirected to the login page
Best Practices
Security
- Use HTTPS: Always use HTTPS endpoints for redirect URIs in production
- Limit redirect URIs: Only register the exact URIs you need
- Regular audits: Periodically review OAuth credentials and permissions
Compliance
- Audit logs: Enable Google Workspace audit logs for compliance
- Data retention: Configure log retention policies according to requirements
Troubleshooting
Issue: Redirect URI mismatch
Symptoms: "redirect_uri_mismatch" error during authentication
Solution:
- Verify that the redirect URI in Google Cloud Console exactly matches
https://<YOUR_KUBESENSE_DOMAIN>/login - Check for trailing slashes, HTTP vs HTTPS, and case sensitivity
- Ensure there are no extra spaces or characters
- Verify the domain matches your actual KubeSense deployment URL
Issue: Invalid client credentials
Symptoms: "invalid_client" error during authentication
Solution:
- Verify that the Client ID in your KubeSense values file are correct
- Check for any typos or extra spaces in the configuration
- Ensure the credentials are from the correct Google Cloud project
- Verify that the OAuth client is enabled in Google Cloud Console
Issue: Access blocked
Symptoms: "access_denied" or "Access blocked" error
Solution:
- Check OAuth consent screen configuration
- Verify that your Google account has access to the application
- Check if your organization has restrictions on third-party app access
Issue: Cannot sign in with organization account
Symptoms: Authentication fails or "incompatible account type" error
Solution:
- Verify the OAuth consent screen is set to "Internal" for Google Workspace-only access
- Ensure users have accounts in the correct Google Workspace organization
- Check if multi-factor authentication (MFA) is required
- Verify that the user's email domain matches the authorized domains
Additional Configuration Options
Restrict Access by Domain
To restrict access to specific email domains:
- In Google Cloud Console, go to OAuth consent screen
- Under Authorized domains, add your organization's domain
- Configure domain restrictions in your Google Workspace admin console if needed
Configure Token Lifecycle
For enhanced security, consider configuring token expiration:
- Navigate to APIs & Services → Credentials in Google Cloud Console
- Configure OAuth 2.0 client settings
- Set appropriate token expiration times based on your security policies
Conclusion
Google Workspace integration provides enterprise-grade authentication for KubeSense, enabling your organization to use existing Google credentials for secure access. By properly configuring the OAuth 2.0 credentials, redirect URIs, and KubeSense values, you can provide a seamless authentication experience while maintaining security and compliance standards.