Broker 10.5 | webMethods Broker Documentation | webMethods Broker Client Java API Programmer's Guide | Working with Basic Authentication | Configuring the Broker Java Client for Basic Authentication | Configuring Basic Authentication by using BrokerConnectionDescriptor Class
Configuring Basic Authentication by using BrokerConnectionDescriptor Class
For your Java client, use the BrokerConnectionDescriptor.setAuthInfo method described on page to enable basic authentication, prior to creating a BrokerClient.
When a BrokerConnectionDescriptor is created, the authentication information will be set to null by default. Therefore, you must use the setAuthInfo method before creating a Broker client if you want to enable basic authentication.
Return Type
Method Signature and Description
public void setAuthInfo(
String username,
String password)
Where username is the user name for basic authentication and password is the password for the basic authentication user.
The following code sample shows how to configure the settings for Broker basic authentication by using the BrokerConnectionDescriptor.setAuthInfo method, passing in the parameters described in the table above:
// Build the connection descriptor.
BrokerConnectionDescriptor connectionDescriptor =
new BrokerConnectionDescriptor()
String username = "sag";
String password = "SoftwareAG123";
// Create a new Broker client.
client = new BrokerClient(broker_host, broker_name, client_id,client_group,
app_name, connectionDescriptor)