---
title: Google Cloud Platform connector
description: Google Cloud Platform (GCP) is a suite of cloud computing services offered by Google. The GCP connector lets you manage and synchronize accounts between GCP and IDM managed user objects. A GCP administrator account is required for this connector to work.
component: openicf
page_id: openicf:connector-reference:gcp
canonical_url: https://docs.pingidentity.com/openicf/connector-reference/gcp.html
section_ids:
  before_you_start: Before you start
  install_the_gcp_connector: Install the GCP connector
  configure_the_gcp_connector: Configure the GCP connector
  test_the_gcp_connector: Test the GCP connector
  gcp_remote_connector: GCP remote connector
  config-connection-pooling-gcp: Configure connection pooling
  use_the_gcp_connector: Use the GCP connector
  implemented-interfaces-org-forgerock-openicf-connectors-gcp-GcpConnector-1.5.20.34: OpenICF Interfaces Implemented by the GCP Connector
  config-properties-org-forgerock-openicf-connectors-gcp-GcpConnector-1.5.20.34: GCP Connector Configuration
  configuration-properties-org-forgerock-openicf-connectors-gcp-GcpConnector-1.5.20.34: Configuration properties
  basic-configuration-properties-org-forgerock-openicf-connectors-gcp-GcpConnector-1.5.20.34: Basic Configuration Properties
---

# Google Cloud Platform connector

Google Cloud Platform (GCP) is a suite of cloud computing services offered by Google. The GCP connector lets you manage and synchronize accounts between GCP and IDM managed user objects. A GCP administrator account is required for this connector to work.

## Before you start

Before you configure the connector, log in to your GCP administrator account and note the following:

* Domain name

  The domain name of the account on GCP — for example, example.com.

* Private key

  The private key is required to sign the JWT token used to authenticate with GCP.

* Service account

  The GCP connector uses a service account with [two-legged OAuth](https://developers.google.com/identity/protocols/oauth2/service-account) to connect to GCP. A service account is identified by its email address, which is unique to the account.

* Admin user

  The GCP administrator username.

|   |                                                                                                                                                                         |
| - | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|   | The [Admin SDK API](https://developers.google.com/admin-sdk/directory/v1/guides) must also be enabled to allow viewing and managing users in the Google Cloud Platform. |

## Install the GCP connector

|   |                                                                                                                                                                                                                                                                                                 |
| - | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|   | To check for an Advanced Identity Cloud application for this connector, refer to:- [Application management](https://docs.pingidentity.com/pingoneaic/latest/app-management/applications.html)

- [App catalog](https://docs.pingidentity.com/pingoneaic/latest/app-management/app-catalog.html) |

You can download any connector from [Backstage](https://backstage.forgerock.com/downloads/browse/idm/featured/connectors), but some are included in the default deployment for Advanced Identity Cloud, IDM, or RCS. When using an included connector, you can skip installing it and move directly to configuration.

**Connector included in default deployment**

| Connector                               | IDM                     | RCS                     |
| --------------------------------------- | ----------------------- | ----------------------- |
| [Google Cloud Platform (GCP)](gcp.html) | [icon: times, set=fa]No | [icon: times, set=fa]No |

Download the connector .jar file from [Backstage](https://backstage.forgerock.com/downloads/browse/idm/featured/connectors).

* If you're running the connector locally, place it in the `/path/to/openidm/connectors` directory, for example:

  ```
  mv ~/Downloads/gcp-connector-1.5.20.34.jar /path/to/openidm/connectors/
  ```

* If you're using a remote connector server (RCS), place it in the `/path/to/openicf/connectors` directory on the RCS.

## Configure the GCP connector

Create a connector configuration using the IDM admin UI:

1. From the navigation bar, click Configure > Connectors.

2. On the Connectors page, click New Connector.

3. On the New Connector page, type a Connector Name.

4. From the Connector Type list, select GCP Connector - 1.5.20.34.

5. Complete the Base Connector Details and any applicable Additional Options.

   |   |                                                                                                              |
   | - | ------------------------------------------------------------------------------------------------------------ |
   |   | For a list of all configuration properties, refer to [GCP Connector Configuration](#gcp-config-prop-ezLink). |

6. Click Save.

When your connector is configured correctly, the connector displays as Active in the admin UI.

Refer to [this procedure](configure-connector.html#connector-wiz-REST) to create a connector configuration over REST.

### Test the GCP connector

You can test the configuration is correct by running the following command:

```
curl \
--header "X-OpenIDM-Username: openidm-admin" \
--header "X-OpenIDM-Password: openidm-admin" \
--header "Accept-API-Version: resource=1.0" \
--request POST \
"http://localhost:8080/openidm/system/gcp?_action=test"
{
  "name": "gcp",
  "enabled": true,
  "config": "config/provisioner.openicf/gcp",
  "connectorRef": {
    "bundleVersion": "[1.5.0.0,1.6.0.0)",
    "bundleName": "org.forgerock.openicf.connectors.gcp-connector",
    "connectorName": "org.forgerock.openicf.connectors.gcp.GcpConnector"
  },
  "displayName": "GCP Connector",
  "objectTypes": [
    "__ACCOUNT__",
    "__ALL__"
  ],
  "ok": true
}
```

If the command returns `"ok": true`, your connector was configured correctly, and can authenticate to the Google Cloud Platform system.

### GCP remote connector

If you want to run this connector outside of PingOne Advanced Identity Cloud or IDM, you can configure the GCP connector as a remote connector. Java Connectors installed remotely on a Java Connector Server function identically to those bundled locally within PingOne Advanced Identity Cloud or installed locally on IDM.

You can download the GCP connector [from here](https://backstage.forgerock.com/downloads/browse/idm/all/productId:idm-connectors).

Refer to [Remote connectors](remote-connector.html) for configuring the GCP remote connector.

### Configure connection pooling

The GCP connector supports [HTTP pooling](pooling.html#http-pooling), which can substantially improve the performance of the connector. Learn more about the basic connection pooling configuration and different pooling mechanisms described in [Connection pooling configuration](pooling.html).

## Use the GCP connector

The following GCP account attributes are supported by the GCP connector:

| Attribute       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `__NAME__`      | The username of the user. This maps to a user's `primaryEmail` property in GCP. Required.                                                                                                                                                                                                                                                                                                                                                                             |
| `__PASSWORD__`  | Password for the user account. Required.                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `givenName`     | The first name of the user. Required.                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `familyName`    | The last name of the user. Required.                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `__UID__`       | The user ID for the user account.                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `emails`        | A list of emails associated with the user account. For example:```json
"emails": [
    {
        "address": "liz@example.com",
        "type": "home",
        "customType": "",
        "primary": false
    }
],
```                                                                                                                                                                                                                                                |
| `addresses`     | A list of addresses associated with the user account. For example:```json
"addresses": [
    {
        "type": "work",
        "customType": "",
        "streetAddress": "1234 Example Road",
        "locality": "Mountain View",
        "region": "CA",
        "postalCode": "94043"
    }
],
```                                                                                                                                                                |
| `organizations` | A list of organizations the user account is associated with. For example:```json
"organizations": [
    {
        "symbol": "Texas",
        "customType": "te",
        "costCenter": "Accounting Principles",
        "domain": "IAM",
        "name": "cloudauth",
        "description": "Agreed Accounting Principles",
        "location": "California",
        "department": "engineering",
        "title": "member",
        "type": "unknown"
    }
],
``` |
| `phones`        | A list of phone numbers associated with the user account. For example:```json
"phones": [
    {
        "customType": "custom",
        "type": "custom",
        "value": "+1 888 555 2312",
        "primary": false
    }
],
```                                                                                                                                                                                                                                   |
| `relations`     | A list of the user's relationships to other users. For example:```json
"relations": [
    {
        "customType": "Cousin",
        "type": "custom",
        "value": "Bob Jensen"
    }
]
```                                                                                                                                                                                                                                                                       |
| `externalIds`   | A list of external IDs for the user, such as employee or network IDs. For example:```json
"externalIds": [
    {
        "customType": "employee",
        "type": "custom",
        "value": "12345"
    }
],
```                                                                                                                                                                                                                                                    |

For a full list of attributes on GCP user accounts, refer to the [GCP documentation](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users).

You can use the GCP connector to perform the following actions on a GCP account:

> **Collapse: Create a GCP user**
>
> The following example creates a user with the minimum required attributes:
>
> ```
> curl \
> --header "X-OpenIDM-Username: openidm-admin" \
> --header "X-OpenIDM-Password: openidm-admin" \
> --header "Content-Type: application/json" \
> --request POST \
> --data '{
>   "__NAME__": "bjensen@example.com",
>   "__PASSWORD__": "Passw0rd!",
>   "givenName": "Barbara",
>   "familyName": "Jensen"
> }' \
> "http://localhost:8080/openidm/system/gcp/__ACCOUNT__?_action=create"
> {
>   "_id": "115637914640083360831"
> }
> ```
>
> |   |                                                                                                                                                                                    |
> | - | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
> |   | When you create a new user, you must specify *at least* `__NAME__`, `__PASSWORD__`, `givenName`, and `familyName`. Refer to the list of available attributes for more information. |

> **Collapse: Update a GCP user**
>
> You can modify an existing user with a PUT request, including all attributes of the account in the request. The following attributes can be modified on a user:
>
> * `primaryEmail`
>
> * `__PASSWORD__`
>
> * `givenName`
>
> * `familyName`
>
> * `organizations`
>
> * `addresses`
>
> * `emails`
>
> * `externalIds`
>
> * `relations`
>
> * `phones`
>
> For example, to add a new phone to a user:
>
> ```
> curl \
> --header "X-OpenIDM-Username: openidm-admin" \
> --header "X-OpenIDM-Password: openidm-admin" \
> --header "Content-Type: application/json" \
> --header "If-Match:*" \
> --request PUT \
> --data '{
>   "__NAME__": "bjensen@example.com",
>   "phones": [{
>     "type": "mobile",
>     "value": "+1 888 555 2312",
>     "primary": true
>   }]
> }' \
> "http://localhost:8080/openidm/system/gcp/__ACCOUNT__/115637914640083360831"
> {
>   "_id": "115637914640083360831",
>   "givenName": "Barbara",
>   "__UID__": "115637914640083360831",
>   "phones": [
>     {
>       "value": "+1 888 555 2312",
>       "type": "mobile"
>     }
>   ],
>   "__NAME__": "bjensen@example.com",
>   "familyName": "Jensen",
>   "__ENABLE__": false,
>   "emails": [
>     {
>       "address": "bjensen@example.com",
>       "primary": true
>     },
>     {
>       "address": "bjensen@example.com.test-google-a.com"
>     }
>   ]
> }
> ```
>
> |   |                                                                                                          |
> | - | -------------------------------------------------------------------------------------------------------- |
> |   | The updated data may not appear in the initial response, but appears on any future queries of that user. |

> **Collapse: Query GCP users**
>
> The following example queries all GCP users:
>
> ```
> curl \
> --header "X-OpenIDM-Username: openidm-admin" \
> --header "X-OpenIDM-Password: openidm-admin" \
> --header "Content-Type: application/json" \
> --request GET \
> "http://localhost:8080/openidm/system/gcp/__ACCOUNT__?_queryId=query-all-ids"
> {
>   "result": [
>     {
>       "_id": "103181194086915091216"
>     },
>     {
>       "_id": "104153234757881174617"
>     },
>     {
>       "_id": "105181741894703739324"
>     },
>     {
>       "_id": "105644268361304742523"
>     },
>     {
>       "_id": "101682225764075422695"
>     },
>     {
>       "_id": "101516788947553424126"
>     },
>     {
>       "_id": "102825554929567443783"
>     },
>     {
>       "_id": "101429904015255587067"
>     },
>     {
>       "_id": "115637914640083360831"
>     }
>   ],
>   "resultCount": 9,
>   "pagedResultsCookie": null,
>   "totalPagedResultsPolicy": "NONE",
>   "totalPagedResults": -1,
>   "remainingPagedResults": -1
> }
> ```
>
> The following command queries a specific user by their ID:
>
> ```
> curl \
> --header "X-OpenIDM-Username: openidm-admin" \
> --header "X-OpenIDM-Password: openidm-admin" \
> --header "Content-Type: application/json" \
> --request GET \
> "http://localhost:8080/openidm/system/gcp/__ACCOUNT__/115637914640083360831"
> {
>   "_id": "115637914640083360831",
>   "givenName": "Barbara",
>   "__UID__": "115637914640083360831",
>   "phones": [
>     {
>       "value": "+1 888 555 2312",
>       "type": "mobile"
>     }
>   ],
>   "__NAME__": "bjensen@example.com",
>   "familyName": "Jensen",
>   "__ENABLE__": false,
>   "emails": [
>     {
>       "address": "bjensen@example.com",
>       "primary": true
>     },
>     {
>       "address": "bjensen@example.com.test-google-a.com"
>     }
>   ]
> }
> ```

> **Collapse: Reset a GCP account password**
>
> ```
> curl \
> --header "X-OpenIDM-Username: openidm-admin" \
> --header "X-OpenIDM-Password: openidm-admin" \
> --header "Content-Type: application/json" \
> --header "if-Match:*" \
> --request PATCH \
> --data '[{
>   "operation": "add",
>   "field": "__PASSWORD__",
>   "value": "Passw0rd@123!"
> }]' \
> "http://localhost:8080/openidm/system/gcp/__ACCOUNT__/115637914640083360831"
> {
>   "_id": "115637914640083360831",
>   "givenName": "Barbara",
>   "__UID__": "115637914640083360831",
>   "phones": [
>     {
>       "value": "+1 888 555 2312",
>       "type": "mobile"
>     }
>   ],
>   "__NAME__": "bjensen@example.com",
>   "familyName": "Jensen",
>   "__ENABLE__": false,
>   "emails": [
>     {
>       "address": "bjensen@example.com",
>       "primary": true
>     },
>     {
>       "address": "bjensen@example.com.test-google-a.com"
>     }
>   ]
> }
> ```
>
> |   |                                                                                                       |
> | - | ----------------------------------------------------------------------------------------------------- |
> |   | While the `__PASSWORD__` field is not returned as part of the response, the user object *is* updated. |

> **Collapse: Delete a GCP account**
>
> You can use the GCP connector to delete an account from the GCP service.
>
> The following example deletes a GCP account:
>
> ```
> curl \
> --header "X-OpenIDM-Username: openidm-admin" \
> --header "X-OpenIDM-Password: openidm-admin" \
> --header "Content-Type: application/json" \
> --request DELETE \
> "http://localhost:8080/openidm/system/gcp/__ACCOUNT__/115637914640083360831"
> {
>   "_id": "115637914640083360831",
>   "givenName": "Barbara",
>   "__UID__": "115637914640083360831",
>   "phones": [
>     {
>       "value": "+1 888 555 2312",
>       "type": "mobile"
>     }
>   ],
>   "__NAME__": "bjensen@example.com",
>   "familyName": "Jensen",
>   "__ENABLE__": false,
>   "emails": [
>     {
>       "address": "bjensen@example.com",
>       "primary": true
>     },
>     {
>       "address": "bjensen@example.com.test-google-a.com"
>     }
>   ]
> }
> ```

## OpenICF Interfaces Implemented by the GCP Connector

The GCP Connector implements the following OpenICF interfaces. For additional details, see [ICF interfaces](interfaces.html):

* Create

  Creates an object and its `uid`.

* Delete

  Deletes an object, referenced by its `uid`.

* Schema

  Describes the object types, operations, and options that the connector supports.

* Script on Connector

  Enables an application to run a script in the context of the connector.

  Any script that runs on the connector has the following characteristics:

  * The script runs in the same execution environment as the connector and has access to all the classes to which the connector has access.

  * The script has access to a `connector` variable that is equivalent to an initialized instance of the connector. At a minimum, the script can access the connector configuration.

  * The script has access to any script arguments passed in by the application.

* Search

  Searches the target resource for all objects that match the specified object class and filter.

* Test

  Tests the connector configuration.

  Testing a configuration checks all elements of the environment that are referred to by the configuration are available. For example, the connector might make a physical connection to a host that is specified in the configuration to verify that it exists and that the credentials that are specified in the configuration are valid.

  This operation might need to connect to a resource, and, as such, might take some time. Do not invoke this operation too often, such as before every provisioning operation. The test operation is not intended to check that the connector is alive (that is, that its physical connection to the resource has not timed out).

  You can invoke the test operation before a connector configuration has been validated.

* Update

  Updates (modifies or replaces) objects on a target resource.

[]()

## GCP Connector Configuration

The GCP Connector has the following configurable properties:

### Configuration properties

| Property                                               | Type            | Default | Encrypted(1)             | Required(2)               |
| ------------------------------------------------------ | --------------- | ------- | ------------------------ | ------------------------- |
| `domainName`                                           | `String`        | `null`  |                          | [icon: check, set=fas]Yes |
| Provides the domain name for GCP.                      |                 |         |                          |                           |
| `privateKey`                                           | `GuardedString` | `null`  | [icon: lock, set=fas]Yes | [icon: check, set=fas]Yes |
| Provides private key to authenticate GCP.              |                 |         |                          |                           |
| `serviceAccount`                                       | `String`        | `null`  |                          | [icon: check, set=fas]Yes |
| Provides service account for fetching users from GCP.  |                 |         |                          |                           |
| `adminUser`                                            | `String`        | `null`  |                          | [icon: check, set=fas]Yes |
| Provides admin user for fetching users from GCP.       |                 |         |                          |                           |
| `maxResults`                                           | `int`           | `50`    |                          | [icon: times, set=fas]No  |
| Provides user max results for fetching users from GCP. |                 |         |                          |                           |

(1) Whether the property value is considered confidential, and is therefore encrypted in IDM.

(2) A list of operations in this column indicates that the property is required for those operations.

### Basic Configuration Properties

| Property                                            | Type            | Default | Encrypted(1)             | Required(2)              |
| --------------------------------------------------- | --------------- | ------- | ------------------------ | ------------------------ |
| `httpProxyHost`                                     | `String`        | `null`  |                          | [icon: times, set=fas]No |
| Provides the HTTP proxy host.                       |                 |         |                          |                          |
| `httpProxyPort`                                     | `Integer`       | `null`  |                          | [icon: times, set=fas]No |
| Provides the HTTP proxy port.                       |                 |         |                          |                          |
| `httpProxyUsername`                                 | `String`        | `null`  |                          | [icon: times, set=fas]No |
| Provides the HTTP proxy username.                   |                 |         |                          |                          |
| `httpProxyPassword`                                 | `GuardedString` | `null`  | [icon: lock, set=fas]Yes | [icon: times, set=fas]No |
| Provides the HTTP Proxy password.                   |                 |         |                          |                          |
| `connectionTimeout`                                 | `Integer`       | `300`   |                          | [icon: times, set=fas]No |
| Provides the maximum connection timeout in seconds. |                 |         |                          |                          |
| `maximumConnections`                                | `Integer`       | `10`    |                          | [icon: times, set=fas]No |
| Provides the maximum connections.                   |                 |         |                          |                          |

(1) Whether the property value is considered confidential, and is therefore encrypted in IDM.

(2) A list of operations in this column indicates that the property is required for those operations.
