Google Workspace
This connector exports and fulfills users and groups from/to a Google Workspace instance.
This page is about Google Workspace.
Overview
Google Workspace provides a set of software products developed by Google. The Google Workspace connector exports users, groups, and user-group memberships from a Google Workspace instance, and provisions users, their passwords and their group memberships to it.
| Scope | Export | Fulfill |
|---|---|---|
| Users | ✅ | ✅ create, update, delete |
| Groups | ✅ | ❌ |
| Group memberships | ✅ | ✅ add, remove |
| Passwords | N/A | ✅ at creation and by reset |
Organizational units, roles, and role assignments are neither exported nor fulfilled.
Prerequisites
Implementing this connector requires:
- reading first the appsettings.agentdocumentation;
- a service account impersonating the following permission scopes:
| Scope | Usage |
|---|---|
| https://www.googleapis.com/auth/admin.directory.user | Export and fulfill of users |
| https://www.googleapis.com/auth/admin.directory.group | Export of groups and memberships, fulfill of memberships |
| https://www.googleapis.com/auth/admin.directory.userschema.readonly | Discovery of custom user schemas (optional) |
See Google's documentation to create the service account with the right impersonation.
Remember, Google's documentation describes this procedure as optional, while the Google Workspace connector requires it.
Without the admin.directory.userschema.readonly scope, the schema refresh still returns all standard attributes but doesn't include custom schema columns.
To fulfill users with passwords, the agent configuration must also contain the MailSettings and PasswordResetSettings sections (including the encryption certificate), as for the other connectors that support password reset.
Export
This connector extracts users, groups, and user-group memberships from a Google Workspace instance, and writes the output to CSV files.
Configuration
This process is configured through a Connection in the UI and/or the XML configuration, and in the *appsettings.agent.json* > Connections section:
*appsettings.agent.json*
{
...
"Connections": {
...
"<ConnectionIdentifier>": {
...
}
}
}
The identifier of the connection and thus the name of the subsection must:
- be unique.
- not begin with a digit.
- not contain
<,>,:,",/,\,|,?,*and_.
For example:
*appsettings.agent.json*{..."Connections": {..."GoogleExportFulfillment": {"CredentialsFilePath": "C:/identitymanagerDemo/GoogleCredentials.json","User": "B29607@acme.internal","PageSize": "100"}}}
Setting attributes
| Name | Details |
|---|---|
| CredentialsFilePath required | Type String Description Path of Google Workspace's JSON credentials file. See Google's documentation to create these credentials. |
| User required | Type String Description Email address of the service account mentioned in the prerequisites section. |
| PageSize default value: 50 | Type Int32 Description Number of items, i.e. users and/or groups and/or memberships, retrievable from Google Workspace by each API call (from 1 to 500). |
Output details
This connector is meant to generate to the Application SettingsExport Output folder the following CSV files:
GoogleExportFulfillment_Users.csvandGoogleExportFulfillment_Groups.csvwhose headers come from the entity type mapping'sConnectionColumnand from the entity association mappings' columns which aren't members columns;GoogleExportFulfillment_Members.csvwith the following columns:- value: ID of the group;
- MemberId: ID of the group member.
| Column type | Column name | Example |
|---|---|---|
| Single property | {property} | PrimaryEmail, Suspended |
| Sub-property | {property}:{sub-property} | Name:FamilyName |
| Custom schema | CustomSchemas:{schema}:{field} | CustomSchemas:NimData:VIP |
| Structured list | {list}:{property} | Phones:Value, Phones:Type |
| Text list | {property} | Aliases, NonEditableAliases |
The character ":" shouldn't be used in other situations.
For example:
<EntityType Identifier="GOOGLE_Entry" DisplayName_L1="GOOGLE - Entry" DisplayName_L2="GOOGLE - Entree"> <Property Identifier="AgreedToTerms" DisplayName_L1="AgreedToTerms" Type="String" /> <Property Identifier="FamilyName" DisplayName_L1="FamilyName" Type="String" /></EntityType><EntityTypeMapping Identifier="GOOGLE_Entry" Connector="GOOGLE" ConnectionTable="GOOGLE_Users"> <Property Identifier="AgreedToTerms" ConnectionColumn="AgreedToTerms" /> <Property Identifier="FamilyName" ConnectionColumn="Name:FamilyName" /></EntityTypeMapping>This example has
AgreedToTerms, which is a single property, andFamilyNamewhich is a sub-property ofName, hence the nameName:FamilyNameas theConnectionColumn.
Structured lists
The structured lists of a user are Emails, ExternalIds, Organizations, Phones, Addresses, Ims, Relations and Websites. Each element property gives one multi-valued text column, for example Phones:Value and Phones:Type. Nested objects are flattened in the name, for example Emails:PublicKeyEncryptionCertificates:Certificate. Groups export ExternalIds:* the same way.
The columns of a list are aligned by position: the nth value of each column describes the nth element. The primary element comes first. A missing value leaves an empty line, and the empty lines at the end of a column are left out.
For example, a user has two phones and only the second one has a type:
Position Phones:ValuePhones:Type1 +33 1 23 45 67 89(empty) 2 +33 6 12 34 56 78WorkThe exported values are
Phones:Value=+33 1 23 45 67 89\n+33 6 12 34 56 78andPhones:Type=\nWork, where\nis the line break separating the values.
Custom schemas
Custom schema fields are exported with the columns CustomSchemas:{schema}:{field}. Multi-valued fields are exported as multi-valued texts. They require the admin.directory.userschema.readonly scope to be discovered by the schema refresh.
Aliases
Aliases and NonEditableAliases are lists of texts, without element properties. Each one gives a single multi-valued column, with one address per line, sorted alphabetically. Aliases is exported for users and groups, NonEditableAliases for users only. A resource without alias gives an empty value.
<Property Identifier="Aliases" ConnectionColumn="Aliases" />
<Property Identifier="NonEditableAliases" ConnectionColumn="NonEditableAliases" />
NonEditableAliases contains the addresses derived from the secondary domains, which Google manages itself.
The order of the values matters when comparing exported and provisioned values: see Focus on MultivaluedText.
Fulfill
This connector can write to Google Workspace to create, update, and/or delete users, and to add and remove user-group memberships.
Configuration
Same as for export, fulfill is configured through connections.
For example:
*appsettings.agent.json*{..."Connections": {..."GoogleExportFulfillment": {"CredentialsFilePath": "C:/identitymanagerDemo/GoogleCredentials.json","User": "B29607@acme.internal"}}}
Setting attributes
| Name | Details |
|---|---|
| CredentialsFilePath required | Type String Description Path of Google Workspace's JSON credentials file. See Google's documentation to create these credentials. |
| User required | Type String Description Email address of the service account mentioned in the prerequisites section. |
Setting up the provisioning
1. Resource type mapping
The GoogleWorkspaceResourceTypeMapping declares the connection, the password reset setting and the key property. The key property holds the Google identifier of the user and is required to update or delete an account.
<GoogleWorkspaceResourceTypeMapping Identifier="User_To_GOOGLE_Entry" Connection="GOOGLE"
PasswordResetSetting="GoogleWorkSpacePasswordSetting">
<KeyProperty Property="GoogleId" />
<MultiValuedProperty Property="CustomSchemas_NimData_MultiValueTest" />
</GoogleWorkspaceResourceTypeMapping>
KeyProperty: property mapped to the GoogleIdcolumn.MultiValuedProperty: custom schema fields that hold several values. The values are separated by line breaks. An empty value clears the field.
See GoogleWorkspaceResourceTypeMapping. The same settings are available in the resource type mapping form of the UI.
2. Single properties and custom schemas
The values of properties declared with a type (Bool, Int64, DateTime) are converted to this type before being sent to Google.
3. Structured lists
Structured lists are provisioned with one rule per {list}:{property} column. Each rule returns a multi-valued text, one element per line.
<ScalarRule Property="Phones_Value" Policy="Default"
Expression="C#:record: return string.Join("\n", new[] { record.MobileNumber, record.PhoneNumber }.Where(s => !string.IsNullOrEmpty(s)));" />
<ScalarRule Property="Phones_Type" Policy="Default" Expression="Literal:mobile work" />
- The nth value of each column builds the nth element.
- The order of the values must match the exported one, otherwise the provisioning is never verified: see Focus on MultivaluedText.
- An empty value leaves the property unset. An element without any value is left out.
- Only the properties exported by the connector are accepted. A value that doesn't match the property type raises an error naming the column and the value. Google validates the rest (types,
customType). - Nested paths such as
Emails:PublicKeyEncryptionCertificates:*aren't supported.
Google replaces a list as a whole. To clear:
| Goal | Rule |
|---|---|
| A whole list | Return empty values for all its columns: the connector sends [] |
| One element | Return the list without this element |
| One property of an element | Leave an empty line at its position |
A position missing at the end of a column is treated as unset, so a rule can leave a column shorter than the others.
When a list is modified, the connector completes it with the current values of the resource. Values added manually in the Admin console that aren't in the rule are overwritten.
Google accepts only one relation of type manager: the rules must send the manager of the main record only, otherwise Google rejects the order (HTTP 412).
Emails
- The export of the
Emails:*columns excludes the primary address (PrimaryEmail), the aliases (Aliases) and the non-editable aliases (NonEditableAliases), which Google manages itself. The comparison ignores the case. AliasesandNonEditableAliasesare exported in their own column, as sorted multi-valued texts.- Fulfill replaces the whole list of secondary addresses: addresses added manually in the Admin console are overwritten.
- An empty list clears the secondary addresses without touching the primary address or the aliases.
Emails:Primaryhas no effect on write: Google ignores the primary flag of a secondary address.- A secondary address without a type shifts the
Emails:TypeandEmails:Addresscolumns: always set a type in the rule. - The
Emails:PublicKeyEncryptionCertificates:*columns are read-only.
Authentication
Password reset
The connector sets the password of a new account at creation, and resets the password of an existing account on request.
Setting
The password reset setting is referenced by PasswordResetSetting in the resource type mapping.
Behavior
| Mode | At account creation | Reset |
|---|---|---|
| Direct | The generated password is set at creation, to be changed at the first login, and sent by mail | Direct or indirect reset from the UI |
| Two-factor | A random throwaway password is set, and the user chooses a password through a link received by mail | Direct or indirect reset from the UI |
- Google requires a password to create an account. The throwaway password is always random: it ignores the configured default password.
- Google validates the password. At creation, a rejection fails the provisioning order. At reset, the error is shown in the UI. Use
StrengthCheck(for example^.{8,100}$) to filter passwords beforehand. - Changing the password and unlocking the account aren't available: the Directory API can't verify the old password and has no lock.
Credential protection
This connector has no credential attributes, and therefore doesn't use RSA Encryption, nor a CyberArk's AAM Credential Providers Vault.
Still, data protection can be ensured through an Azure Key Vault safe.
Limitations
- Groups aren't fulfilled, only their memberships.
- Organizational units, roles, and role assignments are neither exported nor fulfilled.
- Nested paths in structured lists aren't supported on write.
- Only one
managerrelation per user.