Configuring security credentials for connecting to a REST API
Create a security identity by using the mqsicredentials command, and configure a REST request node in a message flow to use that identity for connecting to a secured REST API. Alternatively, you can use the mqsisetdbparms command.
About this task
Procedure
What to do next
You can use the mqsicredentials and mqsivault commands to show information about the security identities
that are being used for connecting to a REST API. Alternatively, you can use the mqsireportdbparms command. For example:
- Use the mqsicredentials command to show the security
identity for HTTP Basic Authentication and the API key for a stopped integration server, for use
with a REST request
node:
The command returns output similar to the following example:mqsicredentials --work-dir workDir --vault-key vaultKey --report --credential-type rest --credential-name myRESTSecurityIdentity$ mqsicredentials --work-dir workDir --vault-key vaultKey --report --credential-type rest --credential-name myRESTSecurityIdentity BIP15118I: The Integration Server/Integration Node is not running. Only credentials from the 'vault' provider will be shown. BIP15110I: The credential name 'myRESTSecurityIdentity' of type 'rest' contains user name 'myRESTUserID' from provider 'vault' and has the following properties defined: 'authType, password, apiKey' - Alternatively, you can use the mqsireportdbparms command
to show the security identity for HTTP Basic Authentication and the API key, for use with a REST
request
node:
This command returns output similar to the following example:mqsireportdbparms -w c:\workdir\ACEServ1 -n rest::myBasicAuthAndApiKey$ mqsireportdbparms -w c:\workdir\ACEServ1 -n rest::myBasicAuthAndApiKey BIP8180I: The resource name 'rest::myBasicAuthAndApiKey' has userID 'myUserID'. BIP8214I: The resource name 'rest::myBasicAuthAndApiKey' has API key 'C664C588-885A-4F07-9390-9CD7A4F8A89F'. - Use the mqsivault command to display the credentials,
including the password, associated with a
resource:
The command returns output similar to the following example:mqsivault --work-dir /tmp/ACEServ1 --vault-key vaultKey --decode credentials/rest/myRESTSecurityIdentityNamespace: credentials Record: rest/myRESTSecurityIdentity {"name":"myRESTSecurityIdentity","type":"rest","properties":{"apiKey":"myRESTAPIKey","authType":"basicApiKey","password":"myRESTPassword","username":"myRESTUserID"}} - Alternatively, use the mqsireportdbparms command to
validate the password. In the following example, the command is validating the password for a single
security identity for HTTP Basic Authentication, for use with a REST request
node:
This command returns output similar to the following example:mqsireportdbparms -w c:\workdir\ACEServ1 -n rest::myBasicAuth -u myUserID -p password$ mqsireportdbparms -w c:\workdir\ACEServ1 -n rest::myBasicAuth -u myUserID -p password BIP8180I: The resource name 'rest::myBasicAuth' has userID 'myUserID'. BIP8201I: The password you entered, 'password' for resource 'rest::myBasicAuth' and userId 'myUserID' is correct. BIP8071I: Successful command completion.