Example of DB2 trusted context configuration for a single serverAdded by IBM on May 19, 2011 | Version 1 (Original)
|This example shows how to configure DB2® trusted context for enterprise database feeds for a single server.
This example shows how to configure DB2® trusted context for enterprise database feeds for a single server.
In this example, the trusted context is defined in a DB2 database named tcdb
on the host db2server.ibm.com
. MashupHub is installed on server mhub.server.ibm.com
, which matches the trust attribute in the trusted context:
CREATE TRUSTED CONTEXT ctx2 BASED UPON
CONNECTION USING SYSTEM AUTHID mhubusr1 ATTRIBUTES (ADDRESS
WITH USE FOR mhubusr2 WITHOUT AUTHENTICATION ENABLE
- In the MashupHub web.xml files in the installation directory and the WebSphere® configuration tree, add a resource reference named trusted_context1.
- In WebSphere Application Server, create a DB2 JDBC provider and data source jdbc/tcdb using the details for the database tcdb on the host db2server.ibm.com. You do not need to specify the authentication method when you create the data source.
- In WebSphere Application Server, create an authentication alias mhubusr1 that uses the authentication details of database user mhubusr1.
- In WebSphere Application Server, create these users: mhubusr1 and mhubusr2.
- In WebSphere Application Server, map the resource reference trusted_context1 to the data source jdbc/tcdb. In the Specify authentication method section, select Use trusted connections (one-to-one mapping). Select the authentication alias mhubusr1.
- Save the changes and restart the server.
- Log in to MashupHub as mhubusr2 and create a DB2 relational feed using the JNDI name java:comp/env/trusted_context1. The feed will use the trusted context and use a trusted connection. Based on the trusted context, the database user identity will be switched to mhubusr2.
Parent topic: Configuring trusted context on a single server