GET

Use the HTTP GET method with the login resource to request information about the user that is authenticated.


Resource URL

https://host:port/ibmmq/rest/v1/login


Optional query parameters

None.


Request headers

The following headers must be sent with the request:


Request body format

None.


Security requirements

The request must be authenticated by using one of the following authentication mechanisms:


Response status codes

    200
    User queried successfully.

    400
    Invalid data provided.

    401
    Not authenticated.
    An invalid credential was provided.

    404
    Resource was not found.

    500
    Server issue or error code from IBM MQ .


Response headers

The following headers are returned with the response:

    Content-Type
    This header is returned with a value of application/json;charset=utf-8.


Response body format

The response is in JSON format in UTF-8 encoding. The response contains an outer JSON object that contains a single JSON array called user. This array contains the following attributes:

    authenticationMechanism
    String.
    Specifies how the user was authenticated.
    The value is one of the following values:

      form
      The user is authenticated with token authentication.
      basic
      The user is authenticated with HTTP basic authentication.
      clientCertificate
      The user is authenticated with client certificate authentication (X.509).
      noSecurity
      Security is not enabled.

    name
    String.
    Specifies the name of the user that is used to check for authorization.
    This name might be different from the credentials that are specified using, for example, LDAP user mapping or client certificate user mapping.

    role
    JSON array.
    Specifies which roles the user is granted.
    The value is one or more of the following values:

    • MQWebAdmin
    • MQWebAdminRO
    • MQWebUser


Examples

The following example queries the user. The following URL is used with the HTTP GET method:
https://localhost:9443/ibmmq/rest/v1/login
The following JSON response is returned:
{
    "user" : 
    [{
       "name" : "reader",
       "role" : [
           "MQWebAdminRO", 
           "MQWebUser"
       ],
       "authenticationMechanism" : "form"
    }]
}
In cURL, the log in query might look like the following Windows example that uses token based authentication. The LTPA token is retrieved from the cookiejar.txt file by using the -b flag:
curl -k "https://localhost:9443/ibmmq/rest/v1/login" -X GET 
-b c:\cookiejar.txt