Advanced Settings
Establishing a Connection
Connecting to WordPress
To connect to data, set the Url and provide authentication. You must set the URL to your wordpress site, otherwise an error will be thrown indicating that the site was not found.For example, if your site is hosted in 'http://localhost/wp/wordpress', the URL should be 'http://localhost/wp/wordpress' and not 'htpp://localhost'.
Connecting to WordPress
You can use the Basic or OAuth authentication methods to authenticate to WordPress.
Connecting using Basic Authentication
Basic authentication is recommended for a testing environment only.Configure Access to WordPress
- Go to your WordPress host and login with your admin credentials when prompted.
-
Click Plugins and install the REST API and Basic Authentication plugins, both developed by the WordPress API Team.
Alternatively, to install the plugins manually, extract the compressed folders to the wp-content\plugins folder and then enable the plugins via the WordPress admin interface.
After setting the following connection properties, you are ready to connect:
- Url: Set this to your WordPress URL.
- User: Set this to your username.
- Password: Set this to your password.
Connecting using OAuth2.0 Authentication
OAuth requires the authenticating user to interact with WordPress using the browser. The provider facilitates this in various ways as described below.
Configure Access to WordPress
You will need the OAuth 2 Plugin. To install the plugin manually, copy the downloaded folder to the wp-content\plugins folder and then enable the plugin via the WordPress admin interface.
Create an App
Register the provider as an OAuth application to obtain the following connection properties. To create the OAuth app, log into your site as an admin, go to Users -> Applications, and click Add New.
- OAuthClientId
- OAuthClientSecret
- CallbackURL
Set the CallbackURL to http://localhost:portnumber.
Authenticate to WordPress from a Desktop Application
After setting the following connection properties, you are ready to connect:
- Url: Set this to the URL of your WordPress host.
- InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken connection property.
- OAuthClientId: Set this to the client Id you defined for your OAuth app.
- OAuthClientSecret: Set this to the client secret you defined for your OAuth app.
- CallbackURL: Set this to the callback URL you defined for your OAuth app.
- Extracts the access token from the callback URL and authenticates requests.
- Obtains a new access token when the old one expires.
- Saves OAuth values in OAuthSettingsLocation to be persisted across connections.
Authenticate to WordPress from a Web Application
Follow the steps below to get and manage the OAuth token values.
Get an Access Token
Set the following connection properties to obtain the OAuthAccessToken:
- OAuthClientId: Set this to the Client Id in your app settings.
- OAuthClientSecret: Set this to the Client Secret in your app settings.
- Url: Set this to the URL of your WordPress host.
You can then call stored procedures to complete the OAuth exchange:
-
Call the GetOAuthAuthorizationURL stored procedure. Set the AuthMode input to WEB and set the CallbackURL input to the Redirect URI you specified in your app settings.
The stored procedure returns the URL to the OAuth endpoint.
- Log in and authorize the application. You are redirected back to the callback URL.
- Call the GetOAuthAccessToken stored procedure. Set the AuthMode input to WEB. Set the Verifier input to the "code" parameter in the query string of the callback URL.
Connect to Data and Refresh the Token
Set the following properties on the first data connection. This configuration automatically refreshes the OAuth access token when it expires.
- InitiateOAuth: Set this to REFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.
- OAuthSettingsLocation: Set this to the path where the provider will save the OAuth values, to be persisted across connections.
- OAuthClientId: Set this to the Client Id in your app settings.
- OAuthClientSecret: Set this to the Client Secret in your app settings.
- OAuthRefreshToken: Set this to the refresh token returned by GetOAuthAccessToken.
- Url: Set this to your WordPress URL.
On subsequent data connections, set the following:
- InitiateOAuth
- OAuthSettingsLocation
- Url
Customizing the SSL Configuration
By default, the provider attempts to negotiate SSL/TLS by checking the server's certificate against the system's trusted certificate store. To specify another certificate, see the SSLServerCert property for the available formats to do so.
Connecting Through a Firewall or Proxy
HTTP Proxies
To connect through the Windows system proxy, you do not need to set any additional connection properties. To connect to other proxies, set ProxyAutoDetect to false.
In addition, to authenticate to an HTTP proxy, set ProxyAuthScheme, ProxyUser, and ProxyPassword, in addition to ProxyServer and ProxyPort.
Other Proxies
Set the following properties:
- To use a proxy-based firewall, set FirewallType, FirewallServer, and FirewallPort.
- To tunnel the connection, set FirewallType to TUNNEL.
- To authenticate, specify FirewallUser and FirewallPassword.
- To authenticate to a SOCKS proxy, additionally set FirewallType to SOCKS5.
Troubleshooting the Connection
To show provider activity from query execution to network traffic, use Logfile and Verbosity. The examples of common connection errors below show how to use these properties to get more context. Contact the support team for help tracing the source of an error or circumventing a performance issue.
- Authentication errors: Typically, recording a Logfile at Verbosity 4 is necessary to get full details on an authentication error.
- Queries time out: A server that takes too long to respond will exceed the provider's client-side timeout. Often, setting the Timeout property to a higher value will avoid a connection error. Another option is to disable the timeout by setting the property to 0. Setting Verbosity to 2 will show where the time is being spent.
- The certificate presented by the server cannot be validated: This error indicates that the provider cannot validate the server's certificate through the chain of trust. If you are using a self-signed certificate, there is only one certificate in the chain.
To resolve this error, you must verify yourself that the certificate can be trusted and specify to the provider that you trust the certificate. One way you can specify that you trust a certificate is to add the certificate to the trusted system store; another is to set SSLServerCert.