API requester basic authentication to a RESTful API endpoint
zosConnect-2.0 Applies to zosConnect-2.0.
You can specify credentials for basic authentication for connections between the IBM® z/OS Connect server and the RESTful API endpoint by
using the zosconnect_authData element in the server.xml
configuration file. These credentials are different to those used for basic authentication between
the CICS, IMS or z/OS application, and the IBM z/OS Connect server.
Configuring z/OS Connect elements for basic authentication
The following excerpt from a server.xml configuration file shows an example of how to configure basic authentication for the Watson RESTful API.
<zosconnect_authData id="zosconnectBasicAuthConfig"
password="mypassword"
user="Fred"/>
<zosconnect_endpointConnection id="watson-api-explorer"
host="http://watson-api-explorer.example.net"
port="80"
authenticationConfigRef="zosconnectBasicAuthConfig"/>
To configure z/OS Connect to call the RESTful
API using basic authentication, you must configure the zosconnect_authData and
zosconnect_endpointConnection elements.
On the zosconnect_authData element you can use the WebSphere® Liberty profile
securityUtility encode command to encode the password for each user. The
securityUtility command-line tool is available in the
<installation_path>/wlp/bin directory. For more information, see
securityUtility command in the WebSphere Application
Server Liberty documentation.
zosconnect_endpointConnection element- a
host, specifying the HTTP or HTTPS protocol. If you choose to use the HTTPS protocol, you must also specify thesslCertsRefattribute and configure TLS. - a
port, specifying the target port for the API provider. - an
authenticationConfigRef, to reference the basic authentication configuration. This attribute should be used in preference tobasicAuthRefwhich is now deprecated.
For more information about the elements shown in the example above, see zosConnect-2.0 Configuration elements in the Reference section.