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
- In the samples directory, select and double-click tibco.bw.sample.policy.basiccredentialmapping.InvokeRestAPI.zip. For more information, see Accessing Samples.
- In Project Explorer expand the tibco.bw.sample.policy.basiccredentialmapping.InvokeRestAPI project.
- Fully expand the Processes directory and double-click InvokeRestApiProcess.bwp and RestBindingProcess.bwp.
- Set the default ApplicationProfile to match the OS you are running on. For more information, see Setting the Default Application Profile.
- Click .
- At the left hand tree of Debug Configuration wizard, expand BusinessWorks Application and select BWApplication.
- Click the Applications tab and then click the Deselect All button if you have multiple applications. Select the checkbox next to tibco.bw.sample.policy.basiccredentialmapping.InvokeRestAPI.application.
- 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 received 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.