Connect PingOne to IBM WebSphere Using the CData JDBC Driver
IBM WebSphere is a powerful application server that runs many enterprise level Java applications and services. When paired with the CData JDBC Driver for PingOne, IBM WebSphere applications can connect to PingOne and work with data using standard SQL queries instead of complex APIs. This simplifies integration, reduces development effort, and provides secure, real-time access to critical business data.
Prerequisites
- Access to a PingOne account (with API permissions)
- IBM WebSphere Application Server (configured and running)
- CData JDBC Driver for PingOne
- Java Servlet WAR application ready for deployment
Note: This article uses Salesforce as a demonstration data source, but the same steps can be followed to connect to any of the 250+ JDBC Drivers available in our portfolio.
Getting Started
Step 1: Download and install the CData JDBC Driver for PingOne
Download and install the CData JDBC Driver for PingOne, which provides a .jar file: cdata.jdbc.pingone.jar
Step 2: Install and configure IBM Websphere
- Create an account in IBM WebSphere using the official IBM site.
- Install and configure the IBM Websphere Application server in the local system using the documentation: IBM Websphere Application Server
- Once the application server is installed, start the WebSphere Server using the Admin Console in your browser: https://your-server:9043/ibm/console
Step 3: Set up the JDBC provider and data source for PingOne
- Go to Resources, expand the JDBC section, and then select JDBC providers to create a new provider
- Select the appropriate scope from the drop down menu
- Click New to add a JDBC provider
- Choose User defined as the database type
- Enter cdata.jdbc.pingone.PingOneConnectionPoolDataSource as the implementation class name
- Type a name for the provider, for example User defined JDBC Provider
- Enter the full path of the JDBC driver JAR file in the classpath field
- Click Next, then Finish, and save the changes to the master configuration.
- Once the JDBC provider is created, add a JDBC data source.
- Enter the basic details such as Data Source Name and JNDI name
- Select the existing JDBC provider created earlier (e.g., CData PingOne Provider)
- Provide the Implementation class name: cdata.jdbc.pingone.PingOneConnectionPoolDataSource
- Add the Data Store Helper Class Name: com.ibm.websphere.rsadapter.GenericDataStoreHelper
- Configure security by setting authentication aliases if required
- Review the Summary page to verify all details and click Finish to complete the data source creation
- Select the newly created data source from the list and open Custom properties
-
Add the JDBC connection string under the URL property and press OK. For example:
jdbc:pingone:RTK=5246...;AuthScheme=OAuth;WorkerAppEnvironmentId=eebc33a8-xxxx-4f3a-yyyy-d3e5262fd49e;Region=NA;OAuthClientId=client_id;OAuthClientSecret=client_secret;InitiateOAuth=GETANDREFRESH;
To connect to PingOne, configure these properties:
- Region: The region where the data for your PingOne organization is being hosted.
- AuthScheme: The type of authentication to use when connecting to PingOne.
- Either WorkerAppEnvironmentId (required when using the default PingOne domain) or AuthorizationServerURL, configured as described below.
Configuring WorkerAppEnvironmentId
WorkerAppEnvironmentId is the ID of the PingOne environment in which your Worker application resides. This parameter is used only when the environment is using the default PingOne domain (auth.pingone). It is configured after you have created the custom OAuth application you will use to authenticate to PingOne, as described in Creating a Custom OAuth Application in the Help documentation.
First, find the value for this property:
- From the home page of your PingOne organization, move to the navigation sidebar and click Environments.
- Find the environment in which you have created your custom OAuth/Worker application (usually Administrators), and click Manage Environment. The environment's home page displays.
- In the environment's home page navigation sidebar, click Applications.
- Find your OAuth or Worker application details in the list.
-
Copy the value in the Environment ID field.
It should look similar to:
WorkerAppEnvironmentId='11e96fc7-aa4d-4a60-8196-9acf91424eca'
Now set WorkerAppEnvironmentId to the value of the Environment ID field.
Configuring AuthorizationServerURL
AuthorizationServerURL is the base URL of the PingOne authorization server for the environment where your application is located. This property is only used when you have set up a custom domain for the environment, as described in the PingOne platform API documentation. See Custom Domains.
Authenticating to PingOne with OAuth
PingOne supports both OAuth and OAuthClient authentication. In addition to performing the configuration steps described above, there are two more steps to complete to support OAuth or OAuthCliet authentication:
- Create and configure a custom OAuth application, as described in Creating a Custom OAuth Application in the Help documentation.
- To ensure that the driver can access the entities in Data Model, confirm that you have configured the correct roles for the admin user/worker application you will be using, as described in Administrator Roles in the Help documentation.
- Set the appropriate properties for the authscheme and authflow of your choice, as described in the following subsections.
OAuth (Authorization Code grant)
Set AuthScheme to OAuth.
Desktop Applications
Get and Refresh the OAuth Access Token
After setting the following, you are ready to connect:
- InitiateOAuth: GETANDREFRESH. To avoid the need to repeat the OAuth exchange and manually setting the OAuthAccessToken each time you connect, use InitiateOAuth.
- OAuthClientId: The Client ID you obtained when you created your custom OAuth application.
- OAuthClientSecret: The Client Secret you obtained when you created your custom OAuth application.
- CallbackURL: The redirect URI you defined when you registered your custom OAuth application. For example: https://localhost:3333
When you connect, the driver opens PingOne's OAuth endpoint in your default browser. Log in and grant permissions to the application. The driver then completes the OAuth process:
- The driver obtains an access token from PingOne and uses it to request data.
- The OAuth values are saved in the location specified in OAuthSettingsLocation, to be persisted across connections.
The driver refreshes the access token automatically when it expires.
For other OAuth methods, including Web Applications, Headless Machines, or Client Credentials Grant, refer to the Help documentation.
Built-in Connection String Designer
For assistance in constructing the JDBC URL, use the connection string designer built into the PingOne JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.
java -jar cdata.jdbc.pingone.jarFill in the connection properties and copy the connection string to the clipboard.
Note: If the URL property is not available, create it and then add the JDBC connection string.
Tip: Always test the connection string with the driver before entering it in the URL property.
- Now open the data source and choose Test Connection
Step 4: Build the web application
- Build the web application using preferred Java framework (Servlet, JSP, or Spring). The resulting .war file will typically follow a structure like this:
- Define the data access logic using JDBC or JPA, referencing the data source through a JNDI name
- This article walks through JDBC connection setup and deploying a Java Servlet application
- Package the project as a WAR (Web Application Archive) or EAR (Enterprise Archive) file for deployment
- In a terminal compile the java file using the command:
cd webcontent jar cvf ..\PingOneServletApp.war *
PingOneServletApp.war |--webcontent | |--index.jsp -- JSP page (entry point) | | | |--WEB-INF/ --Hidden from direct browser access | |--web.xml -- Deployment descriptor | | | |--classes/ --Compiled .class files | |--com/example/PingOne/ | |--PingOneServlet.class | |--lib/ --Dependency JARs |--cdata.jdbc.pingone.jar
Step 5: Deploy the PingOne application in WebSphere
- In the WebSphere admin console, go to Applications and select Install New Application
- Browse and upload the WAR file, then continue with the installation wizard.
Step 6: Retrieve PingOne data through WebSphere
- Access the application using its context root: http://hostname:port/context-root/page
Note: Ensure the deployed application is started before opening it in the browser.
We can now view the retrieved data from the source. The data is accessible directly through IBM WebSphere. This setup demonstrates how a servlet can be deployed in WebSphere to retrieve PingOne data using the JDBC driver, creating a strong foundation for building advanced PingOne powered enterprise applications.
Get Started with Connecting PingOne to IBM WebSphere
Start connecting PingOne to IBM WebSphere with the CData JDBC Connector today. Download the free 30-day trial and explore how easy it is to enable secure, real-time data access for your applications. As always, our world-class Support Team is available to help with any questions you may have.