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 begin
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".
About this task
To create a token generator 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 import.
- Right-click the selected module and select Open Deployment Editor. The module deployment editor
opens.
- Click the Design tab.
- Select the Web Services Imports node.
- Click Add and select Web Services Client Binding Configurations. The Web Services
Client Binding Configurations node is added under Web Services Imports
and the Component Scoped Reference node is added under the Web Services
Client Binding Configurations node.
- Select the Component Scoped Reference node.
- Click Add and select Service Reference. The Select a Web Service Import window
appears.
- In the window, select your web service import. For example,
sendWebServiceCallToServer.
- Select the Port Qualified Name Binding node that was added.
- Click Add and select Security Request Generator Binding Configuration. The
Security Request Generator Binding Configuration node is added under
Port Qualified Name Binding.
- Select the Security Request Generator Binding
Configuration node.
- Click Add button and select Token Generator. A Token Generator node is added under
Security Request Generator Binding Configuration.
- Select the Token Generator node.
- In the Token generator name field,
type a name for the new token generator. For example, basicAuthToken.
- In the Token generator class field,
ensure that the following token generator class is selected: com.ibm.wsspi.wssecurity.token.UsernameTokenGenerator.
- Select the Part Reference node under
the Token Generator node.
- In the Security token field, select basicAuth. This is the name of the security token that
you created earlier under the import extensions of the module deployment
editor.
- Select the Token Generator node,
then press Add and select Use Value
Type. The Select a Token Type window appears.
- In the window, select Username Token. The Use Value Type node is added under Token Generator.
- Select the Callback Handler node
under the Token Generator node.
- In the Callback handler class drop-down
list, ensure that the following callback handler class is selected: com.ibm.wsspi.wssecurity.auth.callback.NonPromptCallbackHandler. You use the call back handler to manually specify a user ID and
password in the token generator configuration.
- In the User ID and Password fields under the Basic Authentication subsection,
specify the user ID and password for the client. For example, if you
are using the default security settings of IBM® Integration
Designer, you would type admin as both the user ID
and password.
Tip: You can also set your user
ID and password to match the user ID and password of Business Process Manager.
- Press Ctrl-S to save your changes.
What to do next
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".