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:
- Authorization
- This header must be sent if you are using basic authentication. For more information, see Using HTTP basic authentication with the REST API.
Request body format
None.
Security requirements
The request must be authenticated by using one of the following authentication mechanisms:
- For HTTP basic authentication, you must provide the user name and password to authenticate. For more information, see Using HTTP basic authentication with the REST API.
- For token based authentication, you must provide the LTPA token to authenticate. For more information, see Using token based authentication with the REST API.
- For client certificate authentication, you must provide the client certificate to authenticate. For more information, see Using client certificate authentication with the REST API.
Response status codes
- 200
- User queried successfully.
- 400
- Invalid data provided.
- 401
- Not authenticated.
- 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.
- name
- String.
- role
- JSON array.
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