Enforcing Basic Credential Mapping on an Outbound Request

In this sample, basic credential mapping is enforced when InvokeRestApiProcess.bwp process makes a client call to the RestBindingProcess.bwp process.

Procedure

  1. In the samples directory, select policy > basiccredentialmapping > InvokeRestAPI and double-click tibco.bw.sample.policy.basiccredentialmapping.InvokeRestAPI.zip . For more information, see Accessing Samples .
  2. In Project Explorer expand the tibco.bw.sample.policy.basiccredentialmapping.InvokeRestAPI project.
  3. Fully expand the Processes directory and double-click InvokeRestApiProcess.bwp and RestBindingProcess.bwp .
  4. Set the default ApplicationProfile to match the OS you are running on. For more information, see Setting the Default Application Profile.
  5. Click Run > Debug Configurations.
  6. At the left hand tree of Debug Configuration wizard, expand BusinessWorks Application and select BWApplication.
  7. Click the Applications tab and then click the Deselect All button if you have multiple applications. Select the check box next to tibco.bw.sample.policy.basiccredentialmapping.InvokeRestAPI.application.
  8. Click Debug.
    This runs the sample in Debug mode.

Result

The client is successfully invoked and the file invokeRest.log is generated at C:\tmp\policy on a Windows system, or at /tmp/policy on a Unix system.

Understanding the Configuration

The following processes interact with each other in this project:

  • RestBindingProcess.bwp: To ensure the message recieved from InvokeRestApiProcess is sent by an authenticated user, the service side of this process is associated with a Basic Authentication policy that is configured with XML file authentication. The XML file is included in the sample project and stored in your workspace.
  • InvokeRestApiProcess.bwp: To ensure credentials are provided in the request message sent to RestBindingProcess, a Basic Credential Mapping policy configured for fixed credential mapping is associated with the InvokeRESTAPI activity in this process.