Marketo Connector

The Marketo connector lets you synchronize between Identity Cloud managed users and a Marketo leads database. You can synchronize any managed user to Marketo—those who have been added directly to the Identity Cloud repository, and those who have registered themselves through a Social Identity Provider.

The Marketo connector is an implementation of the Scripted Groovy Connector, and lets you interact with leads in a Marketo database, using Groovy scripts for the ICF operations.

To use the Marketo connector, you need the following:

  • A Marketo account

  • A client ID and client secret

  • The REST API URL for your Identity Cloud service

  • A custom list created in your Marketo leads database

To obtain these details from Marketo, see the Marketo documentation.

Configure the Marketo Connector

  1. Create a connector configuration by using the Admin UI:

    Select Configure > Connectors > New Connector and select Marketo Connector - 1.5.20.2 as the connector type.

  2. At a minimum, enable the connector and set the instance name, Client ID, Client Secret, and Connector-Managed List.

    Identity Cloud encrypts the client secret on startup.

    This sample connector configuration shows the mandatory properties:

    Sample Marketo Connector Configuration
    {
        "displayName" : "MarketoConnector",
        "description" : "Connector used to sync users to Marketo leads",
        "author" : "ForgeRock",
        "enabled" : true,
        "connectorRef" : {
            "bundleName" : "org.forgerock.openicf.connectors.marketo-connector",
            "bundleVersion" : "[1.5.19.0,1.6.0.0)",
            "connectorName" : "org.forgerock.openicf.connectors.marketo.MarketoConnector"
        },
        ...
        "configurationProperties" : {
            "instance" : "<INSTANCE_FQDN>",
            "clientId" : "<CLIENT_ID>",
            "clientSecret" : "<CLIENT_SECRET>",
            "leadFields" : null,
            "partitionName" : null,
            "listName" : "<LEAD_LIST_NAME>",
            ...
        },
        ...
    }
    instance

    To locate the REST API endpoint URL in Marketo, select Admin > Web Services, scroll down to REST API, and find the endpoint. Use that REST endpoint as the value of the instance property in your connector configuration. Remove the protocol and /rest from the URL. For example, if the endpoint is https://some-number.mktorest.com/rest, the value of the instance property must be some-number.mktorest.com.

    clientId

    Locate the client ID in the details of your Marketo service LaunchPoint.

    clientSecret

    Locate the client secret in the details of your Marketo service LaunchPoint.

    listName

    The name of the custom list created in your Marketo Leads database.

    For details of all the configuration properties, see Marketo Connector Configuration.

  3. When the connector is configured correctly, you can test its status by running the following command:

    curl \
    --header "Authorization: Bearer *token*" \
    --header "Accept-API-Version: resource=1.0" \
    --request POST \
    "https://tenant-name.forgeblocks.com/openidm/system?_action=test"
    [
      {
        "name": "marketo",
        "enabled": true,
        "config": "config/provisioner.openicf/marketo",
        "objectTypes": [
          "ALL",
          "account"
        ],
        "connectorRef": {
          "bundleName": "org.forgerock.openicf.connectors.marketo-connector",
          "connectorName": "org.forgerock.openicf.connectors.marketo.MarketoConnector",
          "bundleVersion": "[1.5.19.0,1.6.0.0)"
        },
        "displayName": "Marketo Connector",
        "ok": true
      }
    ]

    A status of "ok": true indicates that the connector can reach your Marketo database.

Implementation Specifics

For PATCH requests, a connector can potentially add, remove, or replace an attribute value. The Marketo connector does not implement the add or remove operations, so a PATCH request always replaces the entire attribute value with the new value.

OpenICF Interfaces Implemented by the Marketo Connector

The Marketo Connector implements the following OpenICF interfaces. For additional details, see ICF Interfaces:

Authenticate

Provides simple authentication with two parameters, presumed to be a user name and password.

Create

Creates an object and its <literal>uid</literal>.

Delete

Deletes an object, referenced by its <literal>uid</literal>.

Resolve Username

Resolves an object by its username and returns the uid of the object.

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.

Script on Resource

Runs a script on the target resource that is managed by this connector.

Search

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

Sync

Polls the target resource for synchronization events, that is, native changes to objects on the target resource.

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.

Marketo Connector Configuration

The Marketo Connector has the following configurable properties:

Configuration Properties

Property Type Default Encrypted(1) Required(2)

customSensitiveConfiguration

GuardedString

null

Yes

No

Custom Sensitive Configuration script for Groovy ConfigSlurper

customConfiguration

String

null

No

Custom Configuration script for Groovy ConfigSlurper

instance

String

null

Yes

The Marketo-assigned FQDN for your instance

clientId

String

null

Yes

Your OAuth2 client ID

clientSecret

GuardedString

null

Yes

Yes

Your OAuth2 client secret

leadFields

String

null

No

Comma-delimited list of lead fields to fetch; Leave empty for default set

partitionName

String

null

No

Name of the partition in which to create and update leads; May be left empty

listName

String

null

Yes

Name of the Marketo static list the connector will use to manage leads

accessToken

String

null

Yes

The access token for the application

tokenExpiration

Long

null

Yes

The expiration token for the application

(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.

    [[operation-script-files-properties-org-forgerock-openicf-connectors-marketo-MarketoConnector-1.5.20.2]]
== Operation Script Files Properties
Property Type Default Encrypted(1) Required(2)

createScriptFileName

String

CreateMarketo.groovy

The name of the file used to perform the CREATE operation.

customizerScriptFileName

String

null

No

The script used to customize some function of the connector. Read the documentation for more details.

authenticateScriptFileName

String

null

The name of the file used to perform the AUTHENTICATE operation.

scriptOnResourceScriptFileName

String

null

The name of the file used to perform the RUNSCRIPTONRESOURCE operation.

deleteScriptFileName

String

DeleteMarketo.groovy

The name of the file used to perform the DELETE operation.

resolveUsernameScriptFileName

String

null

The name of the file used to perform the RESOLVE_USERNAME operation.

searchScriptFileName

String

SearchMarketo.groovy

The name of the file used to perform the SEARCH operation.

updateScriptFileName

String

UpdateMarketo.groovy

The name of the file used to perform the UPDATE operation.

schemaScriptFileName

String

SchemaMarketo.groovy

The name of the file used to perform the SCHEMA operation.

testScriptFileName

String

TestMarketo.groovy

The name of the file used to perform the TEST operation.

syncScriptFileName

String

null

The name of the file used to perform the SYNC operation.

(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.

    [[groovy-engine-configuration-properties-org-forgerock-openicf-connectors-marketo-MarketoConnector-1.5.20.2]]
== Groovy Engine configuration Properties
Property Type Default Encrypted(1) Required(2)

targetDirectory

File

null

No

Directory into which to write classes.

warningLevel

int

1

No

Warning Level of the compiler

scriptExtensions

String[]

['groovy']

No

Gets the extensions used to find groovy files

minimumRecompilationInterval

int

100

No

Sets the minimum of time after a script can be recompiled.

scriptBaseClass

String

null

No

Base class name for scripts (must derive from Script)

scriptRoots

String[]

null

Yes

The root folder to load the scripts from. If the value is null or empty the classpath value is used.

tolerance

int

10

No

The error tolerance, which is the number of non-fatal errors (per unit) that should be tolerated before compilation is aborted.

debug

boolean

false

No

If true, debugging code should be activated

classpath

String[]

[]

No

Classpath for use during compilation.

disabledGlobalASTTransformations

String[]

null

No

Sets a list of global AST transformations which should not be loaded even if they are defined in META-INF/org.codehaus.groovy.transform.ASTTransformation files. By default, none is disabled.

verbose

boolean

false

No

If true, the compiler should produce action information

sourceEncoding

String

UTF-8

No

Encoding for source files

recompileGroovySource

boolean

false

No

If set to true recompilation is enabled

(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.