ICF 1.5.20.39

Shopify connector

The Shopify connector lets you provision and manage the users of a Shopify Plus organization through the Shopify SCIM 2.0 API. The connector supports full account lifecycle management, searches, and index-based pagination.

Shopify’s SCIM endpoint doesn’t expose a changelog API, so the connector doesn’t support liveSync. Use scheduled reconciliation to synchronize user data.

Shopify requirements

To configure the connector, you need:

  • A Shopify Plus organization. SCIM provisioning isn’t available on lower Shopify plans.

  • A verified organization domain, with SAML authentication configured for the organization. SCIM manages only users whose email addresses belong to a verified domain.

Complete the following steps to gather the required values, then use them to configure the connector.

  1. In the Shopify admin, go to Settings > Users.

  2. Click Security.

  3. Under SCIM integration, click Generate API token.

  4. Click Copy. Use this as the authToken value when you configure the connector.

Learn more in the Shopify SCIM documentation.

Install the Shopify connector

To check for an Advanced Identity Cloud application for this connector, refer to:

You can download most connectors from Ping Identity Product Downloads, 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

No

No

Download the connector .jar file from Ping Identity Product Downloads.

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

    mv ~/Downloads/shopify-connector-1.5.20.39.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 Shopify connector

To create a connector configuration using a UI, use the Platform admin UI or the legacy admin UI (deprecated). Learn more about creating connector configuration.

Using the Platform admin UI

  1. From the sidebar, click settings_ethernet Provisioners.

  2. On the Provisioners page, click New Provisioner.

  3. In the New Provisioner modal, enter a Name.

  4. From the Connector Type list, select Shopify Connector - 1.5.20.39.

    The UI displays a code editor field with the default provisioner configuration for the Shopify connector.

  5. Make changes to the provisioner configuration, and click Save.

    For a list of all configuration properties, refer to Shopify Connector Configuration.

When your connector is configured correctly, the connection status on the provisioner page displays as Connected.

Using the legacy 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 Shopify Connector - 1.5.20.39.

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

    For a list of all configuration properties, refer to Shopify Connector Configuration.
  6. Click Save.

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

Connection details

Property Description

serviceUri

The base Shopify SCIM endpoint URI. For example, https://shopifyscim.com/scim/v2. Required.

authToken

The Shopify SCIM API bearer token generated in the Shopify admin. Required.

authenticationMethod

The authentication method. The connector supports only static bearer token authentication, so the value must be TOKEN. Defaults to TOKEN. Don’t change this property.

authorizationTokenPrefix

The prefix used in the Authorization HTTP header. The connector supports only bearer token authorization, so the value must be Bearer. Defaults to Bearer. Don’t change this property.

maximumConnections

The maximum size of the HTTP connection pool used. Defaults to 10.

connectionTimeout

The timeout for the underlying HTTPS connection in seconds. Defaults to 30.

If you set authenticationMethod to any value other than TOKEN, or authorizationTokenPrefix to any value other than Bearer, the connector fails validation on startup.

Example Shopify configuration

This excerpt shows a sample Shopify connector configuration:

{
  "configurationProperties" : {
    "serviceUri" : "https://shopifyscim.com/scim/v2",
    "authToken" : "xxxxxxxxxxxxxxxxxx",
    "authenticationMethod" : "TOKEN",
    "authorizationTokenPrefix" : "Bearer",
    "acceptSelfSignedCertificates" : false,
    "disableHostNameVerifier" : false,
    "disableHttpCompression" : false,
    "clientCertAlias" : null,
    "clientCertPassword" : null,
    "maximumConnections" : 10,
    "httpProxyHost" : null,
    "httpProxyPort" : null,
    "httpProxyUsername" : null,
    "httpProxyPassword" : null,
    "connectionTimeout" : 30
  }
}
On startup, IDM encrypts the value of the authToken.

Test the Shopify connector

Test that 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/shopify?_action=test"
{
  "name": "shopify",
  "enabled": true,
  "config": "config/provisioner.openicf/shopify",
  "connectorRef": {
    "bundleVersion": "1.5.20.39",
    "bundleName": "org.forgerock.openicf.connectors.shopify-connector",
    "connectorName": "org.forgerock.openicf.connectors.shopify.ShopifyConnector"
  },
  "displayName": "Shopify Connector",
  "objectTypes": [
    "__ACCOUNT__",
    "__ALL__"
  ],
  "ok": true
}

If the command returns "ok": true, your connector is configured correctly and can authenticate to the Shopify SCIM endpoint.

Shopify remote connector

If you want to run this connector outside of PingOne Advanced Identity Cloud or IDM, you can configure the Shopify 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.

Refer to Remote connectors for configuring the Shopify remote connector.

Configure connection pooling

The Shopify connector supports 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.

Implementation specifics

User lifecycle

When you create a user with __ENABLE__: false, Shopify ignores the active flag in the create payload and always creates the user active. The connector applies the requested state with a follow-up PATCH request after the create succeeds, so disabling a user at creation requires two calls to the Shopify SCIM endpoint.

If you create a user without the firstName or lastName attributes, Shopify rejects the create request with an HTTP 422 error. Specify both attributes when you create a user.

Updates use SCIM PATCH requests, so a partial update changes only the attributes you send. An update that changes only __ENABLE__ sends a minimal patch that updates the SCIM active attribute and doesn’t modify any other field.

Supported search filters

The Shopify connector supports the equals (eq) filter only, on the following attributes:

  • __UID__ (the SCIM id)

  • __NAME__ and userName (the SCIM userName)

  • email (the flat SCIM email attribute; the emails.value path isn’t accepted)

The following example queries a Shopify user by __NAME__:

curl \
--header "X-OpenIDM-Username: openidm-admin" \
--header "X-OpenIDM-Password: openidm-admin" \
--header "Accept-API-Version: resource=1.0" \
--request GET \
"http://localhost:8080/openidm/system/shopify/__ACCOUNT__?_queryFilter=__NAME__%20eq%20%22bjensen%22"

Using any other filter operator throws an error and returns no results.

Searches support standard index-based pagination. When you search without an explicit page size, the connector retrieves every page and returns the complete result set with an exact total count. When you set a page size, the connector returns one page per request and a paged results cookie to fetch the next page.

HTTP error handling

The Shopify connector maps HTTP response statuses to ICF exceptions as follows:

HTTP status Exception

401 Unauthorized

InvalidCredentialException

403 Forbidden

PermissionDeniedException

404 Not Found

UnknownUidException, on read, update, and delete operations; searches return no results

409 Conflict

AlreadyExistsException, on create operations

429 Too Many Requests

RetryableException, including the Retry-After interval in the message

Any other non-2xx status

ConnectorException, including the response body in the message

Use the Shopify connector

You can use the Shopify connector to perform various actions on the following Shopify resources:

Connector resource Shopify resource type

__ACCOUNT__

Users

Create a Shopify user
curl \
--header "X-OpenIDM-Username: openidm-admin" \
--header "X-OpenIDM-Password: openidm-admin" \
--header "Content-Type: application/json" \
--request POST \
--data '{
  "__NAME__": "bjensen",
  "firstName": "Barbara",
  "lastName": "Jensen",
  "email": "bjensen@example.com",
  "roles": [
    "manager"
  ]
}' \
"http://localhost:8080/openidm/system/shopify/__ACCOUNT__?_action=create"
{
  "_id": "670998691",
  "__NAME__": "bjensen",
  "firstName": "Barbara",
  "lastName": "Jensen",
  "email": "bjensen@example.com",
  "roles": [
    "manager"
  ],
  "__ENABLE__": true
}

When you create a new user, you must specify at least the __NAME__, firstName, and lastName attributes. Shopify rejects the create request when either name attribute is missing.

Query all Shopify user IDs
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/shopify/__ACCOUNT__?_queryId=query-all-ids"
{
  "result": [
    {
      "_id": "670998691"
    },
    {
      "_id": "720614633"
    },
    ...
  ],
  "resultCount": 99,
  "pagedResultsCookie": null,
  "totalPagedResultsPolicy": "EXACT",
  "totalPagedResults": 99,
  "remainingPagedResults": -1
}
Query a single Shopify user
curl \
--header "X-OpenIDM-Username: openidm-admin" \
--header "X-OpenIDM-Password: openidm-admin" \
--header "Accept-API-Version: resource=1.0" \
--request GET \
"http://localhost:8080/openidm/system/shopify/__ACCOUNT__/670998691"
{
  "_id": "670998691",
  "__NAME__": "bjensen",
  "firstName": "Barbara",
  "lastName": "Jensen",
  "email": "bjensen@example.com",
  "roles": [
    "manager"
  ],
  "__ENABLE__": true
}
Update a Shopify user

The following example updates the email address of Shopify user 670998691:

curl \
--header "X-OpenIDM-Username: openidm-admin" \
--header "X-OpenIDM-Password: openidm-admin" \
--header "Content-Type: application/json" \
--header "If-Match: *" \
--request PUT \
--data '{
  "email": "barbara.jensen@example.com"
}' \
"http://localhost:8080/openidm/system/shopify/__ACCOUNT__/670998691"
{
  "_id": "670998691",
  "__NAME__": "bjensen",
  "firstName": "Barbara",
  "lastName": "Jensen",
  "email": "barbara.jensen@example.com",
  "roles": [
    "manager"
  ],
  "__ENABLE__": true
}
Delete a Shopify user

The following example deletes Shopify user 670998691:

curl \
--header "X-OpenIDM-Username: openidm-admin" \
--header "X-OpenIDM-Password: openidm-admin" \
--header "Content-Type: application/json" \
--header "If-Match: *" \
--request DELETE \
"http://localhost:8080/openidm/system/shopify/__ACCOUNT__/670998691"
{
  "_id": "670998691",
  "__NAME__": "bjensen"
}

OpenICF Interfaces Implemented by the Shopify Connector

The Shopify 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.

Shopify Connector Configuration

The Shopify Connector has the following configurable properties:

Configuration properties

Property Type Default Encrypted(1) Required(2)

authorizationTokenPrefix

String

Bearer

No

The prefix to be used in the Authorization HTTP header for Token authentication.

authenticationMethod

String

TOKEN

No

Defines which method is to be used to authenticate on the remote server. Options are BASIC (username/password), OAUTH (Client id/secret), JWT_TOKEN (jwt token), or TOKEN (static token).

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

serviceUri

String

null

Yes

Base Shopify endpoint URL. For example, https://my-store.myshopify.com/scim/v2.

login

String

null

No

The service login name.

password

GuardedString

null

Yes

No

The service user password.

tokenEndpoint

String

null

No

When using OAUTH as authentication method, this property defines the endpoint where a new access token should be queried for (https://myserver.com/oauth2/token).

clientId

String

null

No

The client identifier for OAuth2.

clientSecret

GuardedString

null

Yes

No

Secure client secret for OAuth2.

authToken

GuardedString

null

Yes

No

Shopify bearer token used to authenticate API requests

acceptSelfSignedCertificates

boolean

false

No

To be used for debug/test purposes. To be avoided in production.

disableHostNameVerifier

boolean

false

No

To be used for debug/test purposes. To be avoided in production.

disableHttpCompression

boolean

false

No

Set this property to true to disable content compression.

clientCertAlias

String

null

No

If TLS Mutual Auth is needed, set this to the certificate alias from the keystore.

clientCertPassword

GuardedString

null

Yes

No

If TLS Mutual Auth is needed and the client certificate (private key) password is different from the keystore password, set this to the client private key password.

maximumConnections

Integer

10

No

Defines the max size of the HTTP connection pool used.

httpProxyHost

String

null

No

Defines the Hostname if an HTTP proxy is used between the connector and the service.

httpProxyPort

Integer

null

No

Defines the Port if an HTTP proxy is used between the connector and the service.

httpProxyUsername

String

null

No

Defines Proxy Username if an HTTP proxy is used between the connector and the service.

httpProxyPassword

GuardedString

null

Yes

No

Defines Proxy Password if an HTTP proxy is used between the connector and the service.

connectionTimeout

int

30

No

Defines a timeout for the underlying HTTP connection in seconds.

refreshToken

GuardedString

null

No

Used by the refresh_token grant type.

grantType

String

null

No

The OAuth2 grant type to use (client_credentials, refresh_token, or jwt_bearer).

scope

String

null

No

The OAuth2 scope to use.

useBasicAuthForOauthTokenNeg

boolean

true

No

The Authentication method for refresh token (Basic Authentication or Sending the ClientId and Client Secret in the Header).

jwtKey

GuardedString

null

Yes

No

The JWT data structure that represents a cryptographic key.

jwtExpiration

Integer

null

No

Defines the JWT expiration time in minutes.

jwtAlgorithm

String

null

No

The Algorithm type to sign payload.

jwtClaims

Map

null

No

JWT Claims to be included in the payload

jwtPem

GuardedString

null

Yes

No

The contents of the private key of the PEM file

jwtCert

GuardedString

null

Yes

No

The contents of the certificate of the PEM file

keyAlgorithm

String

null

No

Indicates the type of key (such as RSA, DSA or EC) used to sign from the PEM.

userAgent

String

PingIdentityConnector

No

The User Agent HTTP Header used by the connector. Defaults to PingIdentityConnector.

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