SSIS Components for WordPress

Build 25.0.9434

Establishing a Connection

Enabling SSIS in Visual Studio 2022

If you're using Visual Studio 2022, you will need to install the SQL Server Integration Services Projects extension to use SSIS.

  1. Navigate to Extensions > Manage Extensions.
  2. In the Manage Extensions window's search box, search for "SQL Server Integration Services Projects 2022" and select the extension in the list.
  3. Click Download.
  4. Close Visual Studio and run the downloaded Microsoft.DataTools.IntegrationServices.exe installer. Proceed through the installer with default settings.
  5. Open Visual Studio. There should now be an "Integration Services Project" project template available.

Adding the WordPress Connection Manager

Create a new connection manager as follows:

  1. Create a Visual Studio project with the "Integration Services Project" template.
  2. In the project, right-click within the Connection Managers window and select New Connection from the menu.
  3. In the Description column, select CData WordPress Connection Manager and click Add...
  4. Configure the component as described in the next section.

Alternatively, if you have an existing project and CData WordPress Source or CData WordPress Destination:

  1. Right-click your CData WordPress source or destination component in your data flow
  2. Select Edit... to open an editor window.
  3. Click the New... button next to the Connection manager: dropdown selector to create a connection manager.
  4. Configure the component as described in the next section.

Connecting to WordPress

CData SSIS Components for WordPress supports connecting to self-hosted WordPress instances and WordPress Online instances.

  • If you are connecting to self-hosted WordPress, you must provide the URL of your WordPress site and then authenticate.
  • If you are connecting to WordPress Online, you can choose between OAuth 2.0 and OAuth Password authentication.

Connecting to Self-Hosted WordPress

For self-hosted WordPress instances, to connect to data, provide the full URL for your WordPress site, and then authenticate as described below. For example, if your site is hosted at http://localhost/wp/wordpress, you should enter it as http://localhost/wp/wordpress, not just http://localhost. Failing to provide the complete URL will lead to a 'site not found' error.

Self-hosted WordPress instances support two types of authentication:

  • Basic authentication: This method is recommended for use in testing environments. It provides a way to access your WordPress instance.
  • OAuth 2.0 authentication: This method supports secure, browser-based access from various platforms, including desktop applications, web applications, and headless machines.
Note: Choose the method that fits your needs based on the environment and level of security required.

Basic Authentication

Before you configure WordPress to use Basic Authentication, follow these guidelines:

  • Ensure that your WordPress login has administrative privileges.
  • Be aware of the version of WordPress running on the local host. Note: Versions 4.7 and later support the WordPress REST API natively, while earlier versions require a Basic Authentication plug-in to secure REST API access.

To configure Basic Authentication:

  1. Log into your WordPress host.
  2. If you are running an earlier WordPress version than 4.7, install the REST API plugin.
  3. Install the Basic Authentication plugin.
  4. To create custom taxonomies, install the Simple Taxonomy Refreshed plugin.
    If you prefer installing the plugins manually, extract the compressed folders to the wp-content\plugins folder and then enable the plugins via the WordPress admin interface.
  5. Next, set the following connection properties:

You are now ready to connect.

OAuth 2.0 Authentication

For all non-testing environments, WordPress supports OAuth authentication only. To enable this authentication from all OAuth flows, you must set AuthScheme to OAuth, and you must create a custom OAuth application.

The following subsections describe how to authenticate to WordPress from three common authentication flows. For information about how to create a custom OAuth application, see Creating a Custom OAuth Application. For a complete list of connection string properties available in WordPress, see Connection.

Desktop Applications
To authenticate with the credentials for a custom OAuth application, you must get and refresh the OAuth access token. After you do that, you are ready to connect.

Get and refresh the OAuth access token:

  • InitiateOAuth: Set this to GETANDREFRESH. Used to automatically get and refresh the OAuthAccessToken.
  • OAuthClientId: The client Id assigned when you registered your application.
  • OAuthClientSecret: The client secret that was assigned when you registered your application.
  • CallbackURL: The redirect URI that was defined when you registered your application.

When you connect, the component opens WordPress's OAuth endpoint in your default browser. Log in and grant permissions to the application.

After you grant permissions to the application, the component then completes the OAuth process:

  1. The component obtains an access token from WordPress and uses it to request data.
  2. The OAuth values are saved in the path specified in OAuthSettingsLocation. These values persist across connections.

When the access token expires, the component refreshes it automatically.

Automatic refresh of the OAuth access token:

To have the component automatically refresh the OAuth access token, do the following:

  1. Before connecting to data for the first time, set the following connection parameters:
  2. On subsequent data connections, set the following:

OAuthClient Authentication
The client credentials grant type allows authentication from desktop applications or the web. To enable this authscheme, set AuthScheme to OAuthClient. This method requires a custom OAuth application, as described in Creating a Custom OAuth Application.

To connect, set these properties:

  • InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the access token in the connection string.
  • AuthScheme: Set the AuthScheme to OAuthClient to perform authentication with the client credentials grant type.
  • OAuthClientId: The client Id specified in your custom OAuth application.
  • OAuthClientSecret: The client secret specified in your custom OAuth application.
Headless Machines

If you need to log in to a resource that resides on a headless machine, you must authenticate on another device that has an internet browser. You can do this in either of the following ways:

  • Option 1: Obtain the OAuthVerifier value.
  • Option 2: Install the component on a machine with an internet browser and transfer the OAuth authentication values after you authenticate through the usual browser-based flow.

After you execute either Option 1 or Option 2, configure the driver to automatically refresh the access token on the headless machine.

Option 1: Obtaining and Exchanging a Verifier Code

To obtain a verifier code, you must authenticate at the OAuth authorization URL. Do the following:

  1. Authenticate from the machine with an internet browser, and obtain the OAuthVerifier connection property.

    Set the following properties:

  2. Call the GetOAuthAuthorizationURL stored procedure. The stored procedure returns the CallbackURL established when the custom OAuth application was registered. (See Creating a Custom OAuth Application.)

    Copy this URL and paste it into a new browser tab.

  3. Log in and grant permissions to the component. The OAuth application redirects you the redirect URI, with a parameter called code appended. Note the value of this parameter; you will need it later to configure the OAuthVerifier connection property.

  4. Exchange the OAuth verifier code for OAuth refresh and access tokens. On the headless machine, set the following connection properties to obtain the OAuth authentication values:

  5. Test the connection to generate the OAuth settings file.

  6. After you re-set the following properties, you are ready to connect:

    • InitiateOAuth: Set this to REFRESH.
    • OAuthSettingsLocation: The file containing the encrypted OAuth authentication values. To enable the automatic refreshing of the access token, be sure that this file gives read and write permissions to the component.
    • OAuthClientId: The client Id assigned when you registered your application.
    • OAuthClientSecret: The client secret assigned when you registered your application.

Option 2: Transferring OAuth Settings

Prior to connecting on a headless machine, you must install and create a connection with the driver on a device that supports an internet browser. Set the connection properties as described above in "Desktop Applications".

After completing the instructions in "Desktop Applications", the resulting authentication values are encrypted and written to the path specified by OAuthSettingsLocation. The default filename is OAuthSettings.txt.

Test the connection to generate the OAuth settings file, then copy the OAuth settings file to your headless machine.

To connect to data via the headless machine, set the following connection properties:

  • InitiateOAuth: Set this to REFRESH.
  • OAuthSettingsLocation: The path to the OAuth settings file you copied from the machine with the browser. To enable automatic refreshing of the access token, ensure that this file gives read and write permissions to the component.
  • OAuthClientId: The client Id assigned when you registered your custom OAuth application.
  • OAuthClientSecret: The client secret assigned when you registered your custom OAuth application.

Okta

To connect to Okta, set these properties:

  • AuthScheme: Okta.
  • User: The authentiating Okta user.
  • Password: The password of the authenticating Okta user.
  • SSOLoginURL: The SSO provider's login URL.
  • SSOExchangeURL: The url used for the exchange of the SAML token for WordPress credentials. This is optional and if it is NULL WordPress will construct it.

If you are either using a trusted application or proxy that overrides the Okta client request OR configuring MFA, you must use combinations of SSOProperties to authenticate using Okta. Set any of the following, as applicable:

  • APIToken: When authenticating a user via a trusted application or proxy that overrides the Okta client request context, set this to the API Token the customer created from the Okta organization.
  • MFAType: If you have configured the MFA flow, set this to one of the following supported types: OktaVerify, Email, or SMS.
  • MFAPassCode: If you have configured the MFA flow, set this to a valid passcode.
    If you set this to empty or an invalid value, the component issues a one-time password challenge to your device or email. After the passcode is received, reopen the connection where the retrieved one-time password value is set to the MFAPassCode connection property.
  • MFARememberDevice: True by default. Okta supports remembering devices when MFA is required. If remembering devices is allowed according to the configured authentication policies, the component sends a device token to extend MFA authentication lifetime. If you do not want MFA to be remembered, set this variable to False.

Example connection string:

AuthScheme=Okta;SSOLoginURL='https://example.okta.com/home/appType/0bg4ivz6cJRZgCz5d6/46';User=oktaUserName;Password=oktaPassword;URL=YourWordpressSiteURL;

Azure AD

This configuration requires two separate Azure AD applications:

  • The "WordPress" application used for single sign-on, and
  • A custom OAuth application with user_impersonation permission on the Azure Active Directory.

To connect to Azure AD, set the AuthScheme to AzureAD, and set these properties:

  • SSOExchangeURL: The url used for the exchange of the SAML token for WordPress credentials. This is optional and if it is NULL WordPress will construct it.
  • OAuthClientId: The application Id of the connector application, listed in the Overview section of the app registration.
  • OAuthClientSecret: The client secret value of the connector application. Azure AD displays this when you create a new client secret.
  • CallbackURL: The redirect URI of the connector application. For example: https://localhost:33333.
  • InitiateOAuth: Set this to GETANDREFRESH.

To authenticate to Azure AD, set these required properties in SSOProperties:

  • Resource: The application Id URI of the WordPress application, listed in the app registration's Overview section. In most cases this is the URL of your custom WordPress domain.
  • AzureTenant: The Id of the Azure AD tenant where the applications are registered.

Example connection string:

AuthScheme=AzureAD;URL=YourWordpressSiteURL;InitiateOAuth=GETANDREFRESH;OAuthClientId=3ea1c786-d527-4399-8c3b-2e3696ae4b48;OauthClientSecret=xxx;CallbackUrl=https://localhost:33333;SSOProperties='Resource=https://YourWordpressSite/wp-content/plugins/miniorange-saml-20-single-sign-on;AzureTenant=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx';
You are now ready to connect.

PingFederate

To connect to PingFederate, set the AuthScheme to PingFederate.

Before connecting, ensure that your WordPress site is configured with a PingFederate SSO plugin and that the authenticating user is provisioned in the PingFederate Data Store.

Set the following connection properties:

  • User: The PingFederate user. You must also add this user to PingFederate Data Stores. When connecting with a browser, you are redirected to the PingFederate login page to complete authentication.
  • Password: The PingFederate user's password.
  • SSOLoginURL: The PingFederate SSO login URL.
  • SSOExchangeURL (optional): The URL used for exchanging the SAML token for WordPress credentials. If not provided, the component attempts to construct it automatically.

Example connection string:

AuthScheme=PingFederate;URL=https://yourwordpresssite.com;User=myuser@mydomain;Password=mypassword;SSOLoginURL=https://idp.example.com/idp/startSSO.ping;

Connecting to WordPress Online

WordPress Online supports two types of authentication methods:

  1. OAuth 2.0 authentication
  2. OAuth Password authentication

OAuth 2.0 Authentication

OAuth 2.0 is a protocol that allows applications to interact with blogs on WordPress, Your Way, and self-hosted WordPress sites running Jetpack.

The two authentication endpoints are the authorization endpoint and the token request endpoint.

  • https://public-api.wordpress.com/oauth2/authorize
  • https://public-api.wordpress.com/oauth2/token

Before you begin, you must create and register a custom OAuth application with WordPress.com, as described in Creating a Custom OAuth Application. This application provides the client Id, client secret, and redirect URI required to authenticate your application and verify API calls. You can create or manage your applications in the WordPress Applications Manager.

Use these values with the authorization endpoints, which require the following parameters:

When you are ready to connect, set the following connection properties:

There is an optional parameter available that can be used:

  • Scope: Defines the level of access that the authentication token grants to your application. Depending on the value set (or omitted), different access is allowed. Supported values include:
    • Auth: Grants access to /me endpoints for WordPress.com Connect.
    • Global: Grants full access to all the blogs associated with the user's account, including any Jetpack-connected sites. If omitted, access is limited to a single blog.

OAuth Password Authentication

Set the following connection properties:

  • Schema: WordPressOnline.
  • AuthScheme: OAuthPassword.
  • URL: Your WordPress Online URL.
  • OAuthClientId: The client Id assigned when you registered your custom OAuth application.
  • OAuthClientSecret: The client secret assigned when you registered your custom OAuth application.
  • User: Your username.
  • Password: Your password.

Example connection strings:

AuthScheme=OAuthPassword;Schema=WordPressOnline;URL=https://example.wordpress.com;OAuthClientId=yourClientId;OAuthClientSecret=yourClientSecret;User=yourUser;Password=yourPassword;

AuthScheme=OAuth;Schema=WordPressOnline;URL=https://example.wordpress.com;InitiateOAuth=GETANDREFRESH;OAuthClientId=yourClientId;OAuthClientSecret=yourClientSecret;

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9434