Access and authentication for the simplified REST API


Requests to all endpoints in the BMC Helix ITSM simplified REST API must be on behalf of a BMC Helix ITSM user. Before processing a request, the API authenticates the request to determine the user. The API uses the OAuth 2.0 protocol for this authentication, and the process is based on tokens as described in the following section.

Authentication scheme

The BMC Helix ITSM simplified REST API leverages the authentication mechanism of BMC Helix Innovation Suite.

BMC Helix Innovation Suite follows the OAuth 2.0 specification with API tokens provided by BMC Helix Single Sign-On. An authentication token is an opaque string. A token is associated with one BMC Helix ITSM user, which could be either a local user or an LDAP user.

For more information about the authentication mechanism and how you can use BMC Helix Single Sign-On for authentication, see Using authorization REST APIs to consume BMC Helix Single Sign-On.

How to generate authentication tokens

A new token is generated for each user request. The token is valid for a configurable amount of time and acts like a temporary password. The expiry time of the token depends on the idle timeout and absolute timeout.

The following is an example of a sample login request:

POST <Innovation Suite server URL>/api/rx/authentication/loginrequest
Host: localhost
Accept: application/json
X-Requested-By: XMLHttpRequest
Content-Type: application/json;charset=UTF-8

{
   "userName": "user",
   "password": "userpassword",
   "locale": "en-us"
}

The "locale": "en-us" name value pair in the above code is optional. This command returns a cookie. In subsequent REST calls, this cookie is used. 

As a response to the login request, the encoded JWT is sent as a response body:

eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIhPSF7ZW5jfSE9IUFBQUFETEVpaWU3NGRTcldJQ2xLWkpHRmRYUCtyOTZjU0RyeXFwUTFFRWNybWdabXlBPT0iLCJfbG9jYWxlTGFuZ3VhZ2UiOiJlbiIsIm5iZiI6MTYzMTc2ODcxOCwiaXNzIjoiY2xtLXB1bi11dWxpbTcuYm1jLmNvbSIsIl9sb2NhbGVDb3VudHJ5IjoiVVMiLCJfYXV0aFN0cmluZyI6IiE9IXtlbmN9IT0hQUFBQURMRWlpZTc0ZFNyV0lDbEtaUHNvTXd5NnI3clg2cHFtU3c2b2FHRT0iLCJleHAiOjE2MzE3NzI0MzgsIl9jYWNoZUlkIjoxOTUwOTgsImlhdCI6MTYzMTc2ODgzOCwianRpIjoiSURHQURHR1hKNkUzR0FRWjg2V0dRWjg2V0dHR0JZIiwiX2Fic29sdXRlRXhwaXJhdGlvblRpbWUiOjE2MzE4NTUyMzh9.LC_rk4Z28IMwd_QzZOzkTKZixCtqcYtf64XmPFAGwSk
Warning

Protect the API token as securely as a password. If the token is leaked, then delete the user to prevent unauthorized access. 

For more information about BMC Helix Innovation Suite authentication mechanism, see Login information.

Permissions

During authentication, a permission check decides if the user is allowed to perform the requested action. The user must have the required permission in BMC Helix ITSM to perform the operation.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*