Creating a token consumer for the request message

The fifth and final step in implementing basic authentication is to create a token consumer for the request message to be received by the export. The token consumer receives the security token in the request message and validates it.

To create a token consumer for the request message:
  1. If the module deployment editor is closed, open it by completing the following steps:
    1. In the Business Integration view, select the module that contains your Web services export, as shown in the following figure:
      Picture of a server module selected in the Business Integration view
    2. Right-click the selected module and select Open Deployment Editor. The module deployment editor opens.
  2. Click the Export WS-Security tab.
  3. Click the Binding Configurations tab. The Web Services Binding Configurations page opens, as shown in the following figure:
    Picture of the Web Services Binding Configurations page in the module deployment editor
  4. In the Port Component Binding section, complete the following steps:
    1. In the Web service description binding drop-down list, select the Web service description binding corresponding to your Web Service export's service name. For example, in the above figure, the Web service description binding ServerInterfaceExport1_ServerInterfaceHttpService is selected.
    2. In the list of port component bindings, select the port component binding that you want to use for the Web service description binding that you selected. The port component binding comes from the port name of your Web service export. For example, in the above figure, the port component binding receiveWebServiceCallFromClient_ServerInterfaceHttpPort is selected.
  5. Expand the Request Consumer Binding Configuration Details section.
  6. Expand the Token Consumer subsection.
  7. Click Add. The Token Consumer dialog box opens.
  8. In the Token consumer name field, type a name for the new token consumer. For example, con_UNtcon.
  9. In the Token consumer class field, ensure that the com.ibm.wsspi.wssecurity.token.UsernameTokenConsumer class is selected.
  10. In the Security token drop-down list, select the name of the security token that you created on the Extensions page. For example, reqUNToken.
  11. Ensure that the Use value type check box is selected.
  12. In the Value type field, ensure that Username Token is selected.
  13. In the Local name field, ensure that the local name http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken is specified.
  14. Select the Use jaas.config check box to have the security token in the import's request message validated
  15. In the jaas.config name field, type system.wssecurity.UsernameToken. This is the default JAAS configuration name for username tokens and it causes a username token to be validated with a user name and password. The Token Consumer dialog box should now resemble the following figure:
    Picture of the Token Consumer dialog box
  16. Click OK. The new token consumer con_UNtcon is displayed, as shown in the following figure:
    Picture of the new token consumer con_UNtcon
  17. Press Ctrl-S to save your changes.
After you have added a token consumer, you have essentially finished the implementation of basic authentication for your application. You may want to test your implementation by using the integration test client, as described in the topic "Testing authentication using the integration test client."
Related tasks
Enabling security on the server
Creating a security token for the request message
Creating a token generator for the request message
Creating a required security token for the request message
Creating a caller part for the request message
Testing authentication using the integration test client
Disabling security on the server

Feedback
(C) Copyright IBM Corporation 2005, 2006. All Rights Reserved.