Advanced Settings
Establishing a Connection
Authenticating to Stripe
Stripe uses the OAuth authentication standard. To authenticate using OAuth, you will need to create an app to obtain the OAuthClientId, OAuthClientSecret, and CallbackURL connection properties.
Using OAuth Authentication
OAuth requires the authenticating user to interact with Stripe using the browser. The provider facilitates this in various ways as described below.
Custom Credentials
You will need to register an app to obtain the OAuthClientId and OAuthClientSecret.
Web Applications
You need to create an OAuth app to use in the web flow.
Desktop Applications
You need to create an OAuth app.
Headless Machines
In the headless OAuth flow, users need to authenticate via a browser on another machine. You will need to create a custom OAuth app.
Custom Credentials
Desktop Authentication with your OAuth App
Follow the steps below to authenticate with the credentials for a custom OAuth app.Get an OAuth Access Token
After setting the following, you are ready to connect:
- OAuthClientId: Set this to the Client Id in your app settings.
- OAuthClientSecret: Set this to the Client Secret in your app settings.
- CallbackURL: Set this to the Redirect URL in your app settings.
- InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken. .
- 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.
Web Authentication with your OAuth App
When connecting via a Web application, you need to register a custom OAuth app with Stripe.You can then use the provider to get and manage the OAuth token values.
Get an OAuth 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.
You can then call stored procedures to complete the OAuth exchange:
-
Set the AuthMode input to WEB and set the CallbackURL input to the Redirect URI you specified in your app settings. If necessary, set the Permissions parameter to request custom permissions.
The stored procedure returns the URL to the OAuth endpoint.
- Open the URL, log in, and authorize the application. You are redirected back to the callback URL.
- Set the AuthMode input to WEB. Set the Verifier input to the "code" parameter in the query string of the callback URL. If necessary, set the Permissions parameter to request custom permissions.
To connect to data, set the OAuthAccessToken connection property to the access token returned by the stored procedure.
Creating a Custom OAuth App
There are two authentication methods available for connecting to Stripe:
- Using API keys
- Using OAuth
Using API Keys
Use your personal API keys to test and to access your own data. To obtain the API keys, follow the steps below:
- Log into Stripe.
- Click Your Account and then click API Keys.
- Set the OAuthAccessToken property to a test or live secret key in the API Keys section.
Using OAuth
Use OAuth to access your own data and to enable other users to access their own data.
OAuth requires the authenticating user to interact with Stripe using the browser. The provider facilitates this in various ways as described in the following sections.
Create an App
You can follow the procedure below to obtain the OAuth client credentials, the OAuthClientId and OAuthClientSecret:
- Log into your Stripe dashboard and click Your Account -> Account Settings -> Connect -> Platform Settings.
- Enter a name, description, and other information to be displayed to users when they log in to grant permissions to your app.
-
If you are making a desktop application, set the Redirect URL to https://oauth.cdata.com/oauth/ .
If you are making a Web application, set the Redirect URL to a page on your Web app you would like the user to be returned to after they have authorized your application.
Authenticate to Stripe from a Desktop Application
After setting the following connection properties, you are ready to connect:
- OAuthClientId: Set this to the client_id in the Connect -> Settings -> Platform Settings section of your account.
- OAuthClientSecret: Set this to a Secret key in the API -> API Keys section of your account.
- CallbackURL: Set this to the Redirect URI in the Connect -> Settings -> Platform Settings section of your account.
- InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken connection property.
- Extracts the access token from the callback URL and authenticates requests.
- Refreshes the access token when it expires.
- Saves OAuth values in OAuthSettingsLocation to be persisted across connections.
Authenticate to Stripe from a Web Application
To obtain the access token, set the following connection properties:
- OAuthClientId: Set this to the client_id in the Connect -> Settings -> Platform Settings section of your account.
- OAuthClientSecret: Set this to a Secret key in the API -> API Keys section of your account.
When connecting via a Web application, or if the provider is not authorized to open a browser window, you need to exchange a verifier code for the OAuthAccessToken:
- Call GetOAuthAuthorizationURL. The stored procedure returns the URL to the OAuth endpoint.
- Log in and authorize the application. You are redirected back to the CallbackURL.
- Extract the verifier code from the "code" query string parameter of the CallbackURL and call GetOAuthAccessToken.
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.