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 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 must also be enabled to allow viewing and managing users in the Google Cloud Platform. |
Install the GCP connector
If you are looking for the Advanced Identity Cloud application for this connector, refer to: |
You can download any connector from Backstage, 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 | IDM | RCS |
---|---|---|
No |
No |
Download the connector .jar file from Backstage.
-
If you are running the connector locally, place it in the
/path/to/openidm/connectors
directory, for example:mv ~/Downloads/gcp-connector-1.5.20.26.jar /path/to/openidm/connectors/
-
If you are 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:
-
From the navigation bar, click Configure > Connectors.
-
On the Connectors page, click New Connector.
-
On the New Connector page, type a Connector Name.
-
From the Connector Type drop-down list, select GCP Connector - 1.5.20.26.
-
Complete the Base Connector Details.
For a list of all configuration properties, refer to GCP Connector Configuration -
Click Save.
When your connector is configured correctly, the connector displays as Active in the admin UI.
Refer to this procedure 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.
Refer to Remote connectors for configuring the GCP remote connector.
Use the GCP connector
The following GCP account attributes are supported by the GCP connector:
Attribute | Description |
---|---|
|
The username of the user. This maps to a user’s |
|
Password for the user account. Required. |
|
The first name of the user. Required. |
|
The last name of the user. Required. |
|
The user ID for the user account. |
|
A list of emails associated with the user account. For example:
|
|
A list of addresses associated with the user account. For example:
|
|
A list of organizations the user account is associated with. For example:
|
|
A list of phone numbers associated with the user account. For example:
|
|
A list of the user’s relationships to other users. For example:
|
|
A list of external IDs for the user, such as employee or network IDs. For example:
|
For a full list of attributes on GCP user accounts, refer to the GCP documentation.
You can use the GCP connector to perform the following actions on a GCP account:
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 |
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. |
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" } ] }
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 |
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:
- 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) |
---|---|---|---|---|
|
|
|
|
Yes |
Provides the domain name for GCP. |
||||
|
|
|
Yes |
Yes |
Provides private key to authenticate GCP. |
||||
|
|
|
|
Yes |
Provides service account for fetching users from GCP. |
||||
|
|
|
|
Yes |
Provides admin user for fetching users from GCP. |
||||
|
|
|
|
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) |
---|---|---|---|---|
|
|
|
|
No |
Provides the HTTP proxy host. |
||||
|
|
|
|
No |
Provides the HTTP proxy port. |
||||
|
|
|
|
No |
Provides the HTTP proxy username. |
||||
|
|
|
Yes |
No |
Provides the HTTP Proxy password. |
||||
|
|
|
|
No |
Provides the maximum connection timeout in seconds. |
||||
|
|
|
|
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.