[V9.1.0 Jul 2018]

Configuring a basic registry for the IBM MQ Console and REST API

You can configure a basic registry within the mqwebuser.xml file. The user names, passwords, and roles in the xml file are used to authenticate and authorize users of the IBM® MQ Console and the REST API.

Before you begin

  • When you configure users within the basic registry, you must assign each user a role. Each role provides different levels of privilege to access the IBM MQ Console and REST API, and determines the security context that is used when an allowed operation is attempted. You need to understand these roles before you configure the basic registry. For more information about each of the roles, see Roles on the IBM MQ Console and REST API.
  • To complete this task, you must be a user with sufficient privileges to edit the mqwebuser.xml file:
    • [z/OS]On z/OS®, you must have write access to the mqwebuser.xml file.
    • [UNIX, Linux, Windows, IBM i] On all other operating systems, you must be a privileged user.

Procedure

  1. Copy the sample XML file basic_registry.xml from one of the following paths:
    • [UNIX, Linux, Windows]On UNIX, Linux®, and Windows: MQ_INSTALLATION_PATH /web/mq/samp/configuration
    • [z/OS]On z/OS: PathPrefix /web/mq/samp/configuration

      where PathPrefix is the IBM MQ Unix System Services Components installation path.

  2. Place the sample file in the appropriate directory:
    • [UNIX, Linux, Windows]

      On UNIX, Linux, and Windows: MQ_DATA_PATH/web/installations/installationName/servers/mqweb

    • [z/OS]

      On z/OS: WLP_user_directory/servers/mqweb

      where WLP_user_directory is the directory that was specified when the crtmqweb script ran to create the mqweb server definition.

  3. Optional: If you changed any configuration settings in mqwebuser.xml, copy them into the sample file.
  4. Delete the existing mqwebuser.xml file and rename the sample file to mqwebuser.xml.
  5. Edit the new mqwebuser.xml file to add users and groups within the basicRegistry tags.

    Be aware that any user with the MQWebUser role can perform only the operations that the user ID is granted to perform on the queue manager. Therefore, the user ID defined in the registry must have an identical user ID on the system on which IBM MQ is installed. These user IDs must be in the same case, or the mapping between the user IDs can fail.

    For more information about configuring basic user registries, see Configuring a basic user registry for Liberty in the WebSphere® Liberty documentation.

  6. Assign roles to users and groups by editing the mqwebuser.xml file:

    There are several roles available that authorize users and groups to use the IBM MQ Console, and the REST API. Each role grants a different level of access. For more information, see Roles on the IBM MQ Console and REST API.

    • To assign roles and grant access to the IBM MQ Console, add your users and groups between the appropriate security-role tags within the <enterpriseApplication id="com.ibm.mq.console"> tags.

    • To assign roles and grant access to the REST API, add your users and groups between the appropriate security-role tags within the <enterpriseApplication id="com.ibm.mq.rest"> tags.

    For help with the format of the user and group information within the security-role tags, see the examples.

  7. If you provided passwords for users in mqwebuser.xml, you should encode these passwords, to make them more secure, by using the securityUtility encoding command provided by WebSphere Liberty. For more information, see Liberty:securityUtility command in the WebSphere Liberty product documentation.

Example

In the following example, the group MQWebAdminGroup is granted access to the IBM MQ Console with the role MQWebAdmin. The user, reader, is granted access with the role MQWebAdminRO, and the user guest is granted access with the role MQWebUser:
<enterpriseApplication id="com.ibm.mq.console">
        <application-bnd>
            <security-role name="MQWebAdmin">
                <group name="MQWebAdminGroup" realm="defaultRealm"/>
            </security-role>
            <security-role name="MQWebAdminRO">
                <user name="reader" realm="defaultRealm"/>
            </security-role>
            <security-role name="MQWebUser">
                <user name="guest" realm="defaultRealm"/>
            </security-role>
        </application-bnd>
    </enterpriseApplication>
In the following example, the users reader and guest are granted access to the IBM MQ Console. The user user is granted access to the REST API, and any users within the MQAdmin group are granted access to the IBM MQ Console and the REST API. The mftadmin user is granted access to the REST API for MFT :
<enterpriseApplication id="com.ibm.mq.console">
    <application-bnd>
        <security-role name="MQWebAdmin">
            <group name="MQAdmin" realm="defaultRealm"/>
        </security-role>
        <security-role name="MQWebAdminRO">
            <user name="reader" realm="defaultRealm"/>
        </security-role>
        <security-role name="MQWebUser">
            <user name="guest" realm="defaultRealm"/>
        </security-role>
    </application-bnd>
</enterpriseApplication>

<enterpriseApplication id="com.ibm.mq.rest">
    <application-bnd>
        <security-role name="MQWebAdmin">
            <group name="MQAdmin" realm="defaultRealm"/>
        </security-role>
        <security-role name="MQWebUser">
            <user name="user" realm="defaultRealm"/>
        </security-role>
        <security-role name="MFTWebAdmin">
            <user name="mftadmin" realm="defaultRealm"/>
        </security-role>
     </application-bnd>
</enterpriseApplication>

What to do next

Choose how users authenticate:
IBM MQ Console authentication options
  • Let users authenticate by using token authentication. In this case, a user enters a user ID and password at the IBM MQ Console log in screen. An LTPA token is generated that enables the user to remain logged in and authorized for a set amount of time. No further configuration is required to use this authentication option, but you can optionally configure the expiry interval for the LTPA token. For more information, see Configuring the LTPA token expiry interval.
  • Let users authenticate by using client certificates. In this case, the user does not use a user ID or password to log in to the IBM MQ Console, but uses the client certificate instead. For more information, see Using client certificate authentication with the REST API and IBM MQ Console.
REST API authentication options
  • Let users authenticate by using HTTP basic authentication. In this case, a user name and password is encoded, but not encrypted, and sent with each REST API request to authenticate and authorize the user for that request. In order for this authentication to be secure, you must use a secure connection. That is, you must use HTTPS. For more information, see Using HTTP basic authentication with the REST API.
  • Let users authenticate by using token authentication. In this case, a user provides a user ID and password to the REST API login resource with the HTTP POST method. An LTPA token is generated that enables the user to remain logged in and authorized for a set amount of time. For more information, see Using token-based authentication with the REST API. You can configure the expiry interval for the LTPA token. For more information, see Configuring the LTPA token.
  • Let users authenticate by using client certificates. In this case, the user does not use a user ID or password to log in to the REST API, but uses the client certificate instead. For more information, see Using client certificate authentication with the REST API and IBM MQ Console.