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.
About this task
To create a token consumer for the request message:
Procedure
- If the module deployment editor is closed, open it by completing
the following steps:
- In the Business Integration view,
select the module that contains your web services export.
- Right-click the selected module and select Open Deployment Editor. The module deployment editor
opens.
- Click the Design tab.
- Select the Web Services Exports node.
- Click Add and select Web Services Binding Configurations. The Web Services
Binding Configurations node is added immediately after Web Service Exports.
- Select the Web Services Binding Configurations node.
- Click Add and select Web Service Description Binding. The Select a Web Service
Export window appears.
- In the window, select your web service export. For example,
receiveWebServiceCallFromClient.
- Select the Port Component Binding node that was added.
- Click Add and select Request Consumer Binding Configuration Details. The Request
Consumer Binding Configuration Details node is added under Port Component
Binding.
- Select the Request Consumer Binding Configuration
Details node.
- Click Add and select Token Consumer. A Token Consumer node is added under
Request Consumer Binding Configuration Details.
- Select the Token Consumer node.
- In the Token consumer name field,
type a name for the new token consumer. For example, con_UNtcon.
- In the Token consumer class field,
ensure that the com.ibm.wsspi.wssecurity.token.UsernameTokenConsumer class is selected.
- Select the Token Consumer node.
- Click Add and select Part Reference. The Part Reference node is added under
Token Consumer.
- In the Security token field, select
the security token that you created under the extensions. For example,
reqUNToken.
- Select the Token Consumer node.
- Click Add and select Use Value Type. The Select a Token Type window appears.
- In the window, select Username Token. A Use Value Type node is added under Token Consumer.
- Select the Token Consumer node.
- Click Add and select Use jaas.config to have the security token in the import's
request message validated. The Use jaas.config node is added under
Token Consumer.
- 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.
- Press Ctrl-S to save your changes.
What to do next
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."