Creating a token generator for the request message

The second step in implementing basic authentication is to create a token generator for the request message to be sent by the import. The token generator reads the user name and password from the configuration file and generates the username token with the user name and password.

Before you create a token generator, you should ensure that you have created a security token, as described in the topic "Creating a security token for the request message."
To create a token generator 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 import, as shown in the following figure:
      Picture of a 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 Import WS-Security tab.
  3. Click the WS Binding tab. The Web Services Client Bindings page opens, as shown in the following figure:
    Picture of the Web Services Client Bindings page in the module deployment editor
  4. In the Service references section, select the Web service reference corresponding to your Web service import. For example, in the above figure, the Web service reference sca/import/sendWebServiceCallToServer is selected.
  5. In the Port Qualified Name Binding section, select the port qualified name binding that you want to use for the Web service reference that you selected. The port qualified name binding comes from the port name of your Web service import. For example, in the above figure, the port qualified name binding receiveWebServiceCallFromClient_ServerInterfaceHttpPort is selected.
  6. Expand the Security Request Generator Binding Configuration section.
  7. Expand the Token Generator subsection.
  8. Click Add. The Token Generator dialog box opens.
  9. In the Token generator name field, type a name for the new token generator. For example, basicAuthToken.
  10. In the Token generator class field, ensure that the following token generator class is selected: com.ibm.wsspi.wssecurity.token.UsernameTokenGenerator.
  11. In the Security token field, select basicAuth. (This is the name of the security token that you created earlier on the WS Extension page of the module deployment editor.)
  12. Select the Use value type check box.
  13. In the Value type field, select Username Token. (The Local name field is automatically populated to reflect your selection of Username Token.)
  14. In the Call back handler drop-down list, ensure that the following call back handler is selected: com.ibm.wsspi.wssecurity.auth.callback.NonPromptCallbackHandler. This call back handler enables you to manually specify a user ID and password within the token generator configuration.
  15. In the User ID and Password fields, specify the user ID and password for the client. For example, if you set up the sample custom user registry by following the instructions in the topic "Enabling security on the server", you would type wid as both the user ID and password. The Token Generator dialog box should now resemble the following figure:
    Picture of the Token Generator dialog box
  16. Click OK. The new token generator basicAuthToken is displayed, as shown in the following figure:
    Picture of the new token generator basicAuthToken
  17. Press Ctrl-S to save your changes.
Now that you have created a token generator, you should create a required security token by following the instructions in the topic "Creating a required security token for the request message."
Related tasks
Enabling security on the server
Creating a security token for the request message
Creating a required security token for the request message
Creating a caller part for the request message
Creating a token consumer 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.