Creating and Configuring a Google Workspace System of Record

Google Workspace provides comprehensive organizational identity and collaboration data that serves as a foundational element for sophisticated access control decisions. By integrating Google Workspace with SGNL, you bring essential user information, organizational structure, group memberships, and administrative context into your access control framework, enabling policies that reflect how your organization actually operates and collaborates.

Prerequisites

  • A Google Workspace account with Admin privileges
  • Access to the Google Cloud Console to create and configure service accounts
  • Understanding of your Google Workspace domain structure and organizational units
  • Knowledge of which user attributes and group structures are most relevant for your access policies

Permissions Required

To successfully configure the Google Workspace integration, you need administrative access to create service accounts and assign appropriate API permissions. The integration requires read access to users, groups, and organizational data throughout your Google Workspace domain.

Google Workspace Admin Permissions: You need Super Admin access or a custom admin role with permissions to manage API access, view user information, manage groups, and access organizational unit data. The integration specifically requires the ability to read user profiles, group memberships, and organizational structures.

Google Cloud Project Access: The integration uses service account authentication, which requires the ability to create and manage service accounts in a Google Cloud project associated with your Google Workspace domain. You’ll need permissions to create service accounts, generate keys, and enable the necessary APIs.

Admin SDK API Access: The integration uses the Google Admin SDK Directory API to access user and group information. This API must be enabled for your Google Cloud project, and the service account must have appropriate scopes for directory access.

Domain-Wide Delegation: To access Google Workspace data on behalf of users, the service account requires domain-wide delegation authority. This allows the service account to impersonate domain administrators and access the necessary directory information.

Configuring Google Workspace

Setting Up OAuth 2.0 with Authorization Code Flow

Google Workspace integration uses OAuth 2.0 with Authorization Code Flow, which is the recommended authentication method for secure, long-term API access with automatic token refresh capabilities.

Creating a Google Cloud Project

  1. Access Google Cloud Console: Navigate to the Google Cloud Console (console.cloud.google.com) and ensure you’re signed in with your Google Workspace admin account
  2. Create or Select Project: Either create a new project specifically for SGNL integration or select an existing project associated with your Google Workspace domain
  3. Enable Admin SDK API: In the project, navigate to APIs & Services → Library, search for “Admin SDK API”, and enable it for your project

Configuring OAuth 2.0 Credentials

  1. Navigate to Credentials: In your Google Cloud project, go to APIs & Services → Credentials
  2. Create OAuth 2.0 Client: Click “Create Credentials” and select “OAuth 2.0 Client IDs”
  3. Configure Application Type: Select “Web application” as the application type
  4. Set Application Name: Provide a descriptive name like “SGNL Workspace Integration”
  5. Configure Redirect URIs: Add your SGNL callback URL as an authorized redirect URI: https://{clientname}.sgnl.cloud/auth/oidcCallback (replace with your client-specific console URL)
  6. Save Credentials: Click “Create” and copy the generated Client ID and Client Secret for use in SGNL configuration
  1. Access OAuth Consent Screen: In your Google Cloud project, go to APIs & Services → OAuth consent screen
  2. Configure User Type: Select “Internal” if this is for your organization only, or “External” if you need broader access
  3. Add Application Information: Provide your application name, user support email, and developer contact information
  4. Configure Scopes: Add the required scopes for directory access:
    • https://www.googleapis.com/auth/admin.directory.user
    • https://www.googleapis.com/auth/admin.directory.group
  5. Review and Submit: Complete the OAuth consent configuration

Understanding Your Domain Structure

Before configuring SGNL, review your Google Workspace domain structure to understand how users and groups are organized. Consider whether you have multiple domains, how organizational units are structured, and whether you want to include deleted users or specific user subsets in your synchronization. The integration supports filtering options that allow you to customize which data is synchronized based on your organization’s needs.

Configuring SGNL

Setting Up the Google Workspace System of Record

  1. Access SGNL Console: Login to the SGNL Console with appropriate administrative privileges
  2. Navigate to Identity Data Fabric: From the left menu, select “Identity Data Fabric”
  3. Add New System of Record: Click “Add System of Record” or “Add” to open the SoR catalog
  4. Select Google Workspace Template: Locate and click on “Google Workspace” in the SGNL SoR Catalog to open the configuration screen with pre-populated settings

Authentication Configuration

Google Workspace uses OAuth 2.0 with Authorization Code Flow for secure authentication with automatic token refresh:

  1. Select Authentication Method: Choose “OAuth 2.0 Authorization Code Flow” as the authentication method
  2. Configure OAuth Parameters: Enter the following configuration details:
    • Client ID: Enter the Client ID you copied from your Google Cloud OAuth 2.0 credentials
    • Client Secret: Enter the Client Secret you copied from your Google Cloud OAuth 2.0 credentials
    • Scope: Enter the required scopes: https://www.googleapis.com/auth/admin.directory.user https://www.googleapis.com/auth/admin.directory.group
    • Token URL: https://oauth2.googleapis.com/token
    • Auth URL: https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&prompt=consent

Note: The access_type=offline parameter in the Auth URL is required for Google Cloud Platform to issue refresh tokens, enabling long-term access without manual re-authentication.

  1. Verify Redirect URI: Ensure that the redirect URI in your SGNL configuration matches exactly what you configured in your Google Cloud OAuth 2.0 credentials
  2. Complete Authorization: Click “Authenticate” and complete the OAuth flow by signing in with a Google Workspace admin account that has the necessary permissions to read directory data

This authentication method provides secure, long-term access with automatic token refresh, eliminating the need for manual token management.

System Configuration

Complete the required configuration parameters for your Google Workspace integration:

Domain Configuration: Replace the {{Input Required}} placeholder in the adapter configuration with your Google Workspace domain name (such as “company.com”). This tells SGNL which domain’s data to synchronize. Note that you can alternatively use a customer ID for multi-domain environments, but exactly one of either domain or customer must be specified.

API Version: The adapter configuration specifies API version “v1”, which is currently the supported version of the Google Admin SDK Directory API.

Adapter Configuration Details

The Google Workspace integration includes a comprehensive adapter configuration that must be properly set up for your specific environment. The adapter configuration is provided as a base64-encoded JSON object that includes the following required and optional parameters:

Required Configuration Parameters

API Version: Set to “v1” to use the current version of the Google Admin SDK Directory API.

Domain or Customer Selection: You must configure exactly one of the following:

  • domain: Use this field to get entities from only one domain (e.g., “company.com”)
  • customer: Use this field for multi-domain accounts to fetch all entities for a customer. This is the unique ID for the customer’s Google Workspace account.

Note: The choice between domain and customer depends on your Google Workspace setup. For single-domain organizations, use domain. For multi-domain organizations where you want to synchronize data across all domains, use customer.

Optional Filtering Configuration

The adapter configuration supports sophisticated filtering options to customize which data is synchronized:

User Filtering Options (filters.user):

  • showDeleted: Set to true to include deleted users in synchronization, or false to exclude them (default: false)
  • query: A search string for filtering users based on specific criteria. For example:
    • "isAdmin=false" to exclude administrative users
    • "isSuspended=false" to exclude suspended users
    • Complex queries can combine multiple criteria

Group Filtering Options (filters.group):

  • query: A search string for filtering groups. For example:
    • "adminCreated=true" to include only administratively created groups
    • "name:Engineering*" to include only groups with names starting with “Engineering”

Member Filtering Options (filters.member):

  • includeDerivedMembership: Set to true to include indirect memberships through nested groups, or false for direct memberships only (default: false)
  • roles: Specify which membership roles to include. Options are:
    • "MEMBER" for standard group members
    • "MANAGER" for group managers
    • "OWNER" for group owners
    • Multiple roles can be specified: "MEMBER,MANAGER,OWNER"

Example Adapter Configuration

Here’s an example of a complete adapter configuration:

{
  "apiVersion": "v1",
  "domain": "yourcompany.com",
  "filters": {
    "user": {
      "showDeleted": false,
      "query": "isAdmin=false"
    },
    "group": {
      "query": "adminCreated=true"
    },
    "member": {
      "includeDerivedMembership": false,
      "roles": "MEMBER,MANAGER,OWNER"
    }
  }
}

This configuration would:

  • Connect to the “yourcompany.com” domain
  • Exclude deleted users and administrative users
  • Include only administratively created groups
  • Include all membership types but only direct memberships (not derived through nested groups)

Configuring Your Adapter Settings

When setting up your Google Workspace integration in SGNL:

  1. Replace Domain Placeholder: Update "domain": "{{Input Required}}" with your actual domain name
  2. Customize User Filtering: Modify the user query based on which users you want to include in your access policies
  3. Adjust Group Filtering: Configure group queries to focus on organizationally relevant groups
  4. Set Membership Scope: Choose whether to include derived memberships and which roles are relevant for your access control needs

For detailed information on query syntax and filtering options, refer to the Google Admin SDK documentation for user searches and group searches.

Advanced Filtering Options

The Google Workspace integration provides sophisticated filtering capabilities that allow you to customize which data is synchronized based on your organization’s needs and access policy requirements.

User Filtering Options: You can configure queries to filter which users are synchronized. For example, you might exclude admin users from general access policies by setting a query like “isAdmin=false”, or include only active users by filtering out suspended accounts. The integration also supports including deleted users if you need to maintain historical access context.

Group Filtering Capabilities: Group synchronization can be filtered to include only administratively created groups or groups matching specific criteria. This is particularly useful for organizations with many informal or automatically generated groups that may not be relevant for access control decisions.

Membership Role Filtering: The integration allows you to specify which membership roles to include when synchronizing group memberships. You can choose to include only standard members, or also include managers and owners, depending on how your organization uses Google Workspace group roles in access decisions.

Derived Membership Options: For complex organizational structures, you can choose whether to include derived (indirect) memberships that result from nested group structures. This affects how SGNL understands the complete scope of user access through group hierarchies.

Understanding Google Workspace Entity Structure

The Google Workspace template defines several interconnected entities that capture the complete organizational and collaborative structure within your domain.

User Entity: Represents individual users within your Google Workspace domain with comprehensive profile information including names, administrative status, login patterns, security settings like two-factor authentication enrollment, suspension status, organizational unit placement, and various account settings. This rich user context enables policies that consider not just identity, but user behavior, security posture, and organizational role.

User Email Entity: Represents the multiple email addresses associated with each user, including primary email, aliases, and alternate addresses. This parent-child relationship structure allows policies to reason about user identity across different email addresses while maintaining the connection to the primary user entity.

Group Entity: Represents Google Workspace groups with information about group purpose, membership counts, administrative creation status, and group characteristics. Groups in Google Workspace often represent both organizational structure (departments, teams) and functional roles (project access, application permissions), making them crucial for access control decisions.

Member Entity: Represents the relationship between users and groups, including membership types (user members vs. nested group members), roles within groups (member, manager, owner), and membership status. This entity captures the complex membership structures that Google Workspace supports, including nested groups and role-based group participation.

The template’s structure reflects Google Workspace’s flexible organizational model where users can have multiple email addresses, belong to numerous groups with different roles, and where groups themselves can be members of other groups, creating rich hierarchical structures for access control.

Complex Relationship Mapping

The Google Workspace template establishes sophisticated relationships that enable SGNL to understand both direct and indirect organizational connections within your domain.

Direct User-Group Relationships: The template creates direct relationships connecting users to their group memberships through the Member entity. These relationships capture not just membership, but also roles within groups and membership types, enabling policies that consider leadership roles and group responsibilities.

Nested Group Structures: Google Workspace supports groups containing other groups, and the template maps these nested relationships through SubGroupMember path relationships. This enables policies that understand inherited permissions and hierarchical organizational structures.

User Email Relationships: The parent-child relationship between User and UserEmail entities allows policies to reason about user identity across multiple email addresses while maintaining organizational context. This is particularly important for access decisions that might be based on specific email addresses or domains.

Complex Membership Paths: The template defines path relationships like UserGroupMember that trace complete membership chains from users through the member relationship to their groups. This enables sophisticated policies that can reason about multi-level organizational structures and complex permission inheritance patterns.

Testing and Verification

After configuring the Google Workspace integration, systematic testing ensures that your organizational data is being correctly imported and that the complex group and membership relationships are properly established.

Initial Connection Test

  1. Save Configuration: Click “Continue” to save your Google Workspace System of Record configuration
  2. Verify Authentication: SGNL will attempt to connect to Google Workspace using your bearer token and domain configuration
  3. Check API Access: Review any error messages related to API permissions or domain access issues
  4. Validate Token Scope: Ensure that your access token has the necessary scopes for directory API access

Enable Entity Synchronization

The Google Workspace integration includes multiple related entities that should be enabled systematically to ensure complete organizational mapping:

  1. Review Entity Structure: Examine each entity type (User, UserEmail, Group, Member) to understand the organizational data each will provide
  2. Enable Core Entities First: Start by enabling User and Group entities to establish the basic organizational structure
  3. Enable Member Relationships: After core entities are synchronizing, enable the Member entity to establish group membership relationships
  4. Enable Child Entities: Enable UserEmail entities to capture the complete user identity picture
  5. Enable System Synchronization: Once all individual entities are enabled, enable synchronization for the entire Google Workspace System of Record

Verify Organizational Data Import

  1. Monitor Synchronization Progress: Watch the import progress for each entity type, noting that Member entities may take longer as they depend on both User and Group entities being present
  2. Validate User Counts: Compare the number of imported users with your expected count based on your domain size and any filtering criteria you’ve applied
  3. Check Group Structure: Verify that both administrative and user-created groups are being imported according to your filtering configuration
  4. Review Membership Relationships: Use SGNL’s interface to spot-check that users are properly connected to their groups and that group roles are correctly represented

Test Complex Organizational Structures

  1. Verify Nested Groups: If your organization uses nested groups, test that subgroup relationships are correctly established and that users inherit permissions through group hierarchies
  2. Check Administrative Roles: Verify that users with administrative privileges are correctly identified and that their elevated status is captured in the integration
  3. Validate Email Relationships: Confirm that users with multiple email addresses have all aliases properly connected to their primary user entity
  4. Test Filtering Results: Verify that any filtering criteria you’ve applied (such as excluding certain user types or groups) are working as expected

Test with DataLens

Once synchronization is complete, use DataLens to explore your Google Workspace organizational data:

  1. Explore User Profiles: Query user information to verify that administrative status, login patterns, and security settings are correctly imported
  2. Test Group Memberships: Verify that group membership relationships are correctly established and that you can query which users belong to which groups
  3. Check Nested Relationships: Test queries that traverse nested group structures to ensure that complex organizational hierarchies are properly mapped
  4. Validate Role Information: Confirm that group roles (member, manager, owner) are correctly captured and can be used in policy queries

Troubleshooting

Authentication and API Access Issues

OAuth Authorization Failures: If SGNL cannot authenticate with Google Workspace, verify that your Client ID and Client Secret are correctly entered and that the OAuth 2.0 credentials are properly configured in Google Cloud Console. Ensure that the redirect URI in SGNL matches exactly what you configured in Google Cloud.

Scope and Permission Issues: If you receive authorization errors, verify that the required scopes (https://www.googleapis.com/auth/admin.directory.user and https://www.googleapis.com/auth/admin.directory.group) are correctly configured and that the authenticating user has Super Admin privileges or appropriate delegated admin permissions in Google Workspace.

API Access and Consent Problems: If synchronization fails with permission errors, ensure that the Admin SDK Directory API is enabled in your Google Cloud project and that the OAuth consent screen is properly configured. The authenticating admin user must consent to the requested scopes during the authorization flow.

Refresh Token Issues: If authentication works initially but fails during subsequent synchronizations, this may indicate refresh token problems. Ensure that the access_type=offline parameter is included in your Auth URL configuration to enable refresh token generation.

Data Synchronization Challenges

Large Domain Performance: Google Workspace domains with thousands of users and complex group structures may experience slow synchronization times. The default API call frequency settings respect Google’s rate limits, but you may need to adjust timing parameters for very large domains or consider implementing more selective filtering.

Complex Group Hierarchy Issues: If nested group relationships are not being properly mapped, ensure that all core entities (User, Group) have completed their initial synchronization before Member entities begin processing. Complex nested structures may require multiple synchronization cycles to fully establish all relationships.

User Filtering Complications: If user filtering isn’t producing expected results, review your query syntax against Google’s directory API documentation. User queries support complex expressions, but syntax errors can cause unexpected filtering behavior or synchronization failures.

Email Address Mapping Problems: If UserEmail entities are not properly connecting to their parent User entities, verify that the parent-child relationship configuration is correct and that users with multiple email addresses are being processed completely before the relationship mapping occurs.

Domain and Organizational Structure Issues

Multi-Domain Configuration: If your organization uses multiple Google Workspace domains, ensure that you’ve configured either the correct primary domain or used the customer ID approach for multi-domain access. Mixing domain and customer configurations can cause synchronization failures.

Organizational Unit Complexity: While the template doesn’t explicitly map organizational units as separate entities, organizational unit paths are captured in user profiles. If organizational unit information isn’t appearing as expected, verify that your domain structure includes the organizational units you expect and that users are correctly assigned to them.

Group Type Confusion: Google Workspace supports various group types (distribution lists, security groups, etc.), and different group types may have different characteristics. If certain groups aren’t synchronizing as expected, review the group types in your domain and consider whether filtering adjustments are needed.

Performance and Scale Considerations

API Rate Limiting: Google Workspace APIs have rate limits that can affect synchronization of large domains. The default configuration respects these limits, but if you encounter throttling errors, you may need to reduce the API call frequency or implement more selective synchronization strategies.

Token Management: OAuth 2.0 access tokens expire and need to be refreshed periodically. For ongoing synchronization, consider implementing automated token refresh mechanisms or monitoring token expiration to prevent synchronization interruptions.

Memory and Processing Requirements: Large Google Workspace domains with complex group structures and extensive user profiles require significant processing power to map all relationships and attributes. Monitor SGNL’s resource usage during initial synchronization and consider optimizing filtering criteria if performance becomes an issue.

Integration with SGNL Policies

Once your Google Workspace integration is successfully configured and synchronized, you can leverage the rich organizational data in sophisticated SGNL policies that reflect how your organization actually operates and collaborates.

Organizational Hierarchy Policies: Use Google Workspace group memberships and roles to create policies that reflect your organizational structure. For example, group managers might automatically receive access to resources related to their group’s function, or department-based groups might determine access to department-specific applications.

Administrative Role-Based Access: Leverage Google Workspace administrative roles to inform access decisions in other systems. Users with Google Workspace admin privileges might receive corresponding elevated access in integrated applications, or conversely, might be subject to additional security requirements.

Security Posture-Based Policies: Use Google Workspace security attributes like two-factor authentication enrollment, account suspension status, and login patterns to create dynamic access policies. Users who haven’t enabled 2FA might be restricted from accessing sensitive resources, or recently inactive users might trigger additional verification requirements.

Collaborative Context Policies: Leverage Google Workspace group structures to understand collaborative relationships and project affiliations. Users who are members of specific project groups might automatically receive access to related development tools, documentation systems, or project management applications.

Email-Based Identity Policies: Use the comprehensive email address mapping to create policies that work across different identity representations. This is particularly valuable for integrating with systems that identify users by different email addresses or for handling identity federation scenarios.

Nested Group Permission Inheritance: Take advantage of Google Workspace’s nested group capabilities to create policies that understand complex organizational hierarchies. Users might inherit permissions through multiple levels of group membership, reflecting real organizational structures and delegation patterns.

For comprehensive guidance on creating policies with Google Workspace organizational data, refer to the SGNL Policy Management documentation. For understanding how Google Workspace entities relate to other identity and business systems in your environment, review the Entities and Relationships guide.