Enforcing Basic Authentication with LDAP Authentication

This sample describes how access to an HTTP service can be managed by enforcing Basic Authentication on a process starter activity. In this sample, the Basic Authentication Policy is associated with the HTTP Receiver Activity and configured to verify user credentials using LDAP authentication.

Prerequisites

You must be connected to an LDAP server and have user and group information stored in that server.

Procedure

  1. In the samples directory, select policy > basicauthentication > HTTPReceiver and double-click tibco.bw.sample.policy.basicauthentication.HttpReceiver.zip. For more information, see Accessing Samples .
  2. In the Project Explorerview, expand the tibco.bw.sample.policy.basicauthentication.HttpReceiver.zip project.
  3. In the Project Explorer view, click Resources > tibco.bw.sample.policy.basicauthentication.httpReceiver > defaultLdapProvider.ldapResource.
  4. Fully expand the Processes directory and double-click HttpReceiverProcess.bwp .
  5. In the Resource Editor, configure the following properties in the LDAP Authentication section under the Connection tab:
    • Server URL: LDAP Server Location, such as, ldap://localhost:389
    • User Search Expression: search expression for the user, such as (&(cn={0])(objectclass=user))
    • User DN Template: user distinguished name template, such as cn={0},cn=users,dc=na,DC=tibco,DC=com
  6. Set the default ApplicationProfile to match the OS you are running on. For more information, see Setting the Default Application Profile.
  7. Fully expand the Processes directory and double-click HttpReceiverProcess.bwp .
  8. Click Run > Debug Configurations.
  9. At the left hand tree of Debug Configuration wizard, expand BusinessWorks Application and select BWApplication.
  10. 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.basicauthentication.HttpReceiver.application .
  11. Click Debug.
    This runs the sample in Debug mode.
  12. Launch Google Chrome browser and enter the following URL http://localhost:9393/request.
    The Google Chrome page displays a window asking you to enter your user name and password.

  13. Enter your LDAP user name and password and click OK.

Result

After the request is authenticated successfully, the following message displays in the browser:

This is from HTTP Receiver Process. The request is successful.

Understanding the Configuration

In the HttpReceiverProcess.bwp process , the Basic Authentication policy is configured to verify user credentials using LDAP Authentication and is associated with the HTTP Receiver activity