TEMS REST services authentication

TEMS REST services provides basic authentication and bearer token security methods for authentication.

Each TEMS REST services request must contain information that identifies the requester as a trusted user; otherwise, the request returns status code 400 (Bad Request) in the response.

TEMS REST services supports two types of authentication:
Note: If you use mixed-case passwords or password phrases (passphrases) for authentication, parameter RTE_SECURITY_FOLD_PASSWORD_FLAG must be set to N.

Basic authentication (username:password)

For basic authentication, you provide user credentials in your TEMS REST services request. Typically, the user credentials are a mainframe user ID and a password (or passphrase). TEMS REST services also supports PassTickets and multi-factor authentication (MFA).

To use basic authentication, you must include in the request the Authorization header containing the word Basic, and the username:password string encoded in Base64, as follows:
Authorization: Basic credentials
where credentials is the username:password string encoded in Base64.

If you do not include the Authorization header in the request, the request responds with status code 400 (Bad Request).

The following example shows how you can use basic authentication in a request using a curl command:
curl -X 'GET' \
  'https://host:port/api/v1/timenow' \
  -H 'accept: application/json' \
  -H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='
where dXNlcm5hbWU6cGFzc3dvcmQ= is the username:password string encoded in Base64.
Note: Implementation of the authorization header varies depending on the REST API tool used for the request.

Bearer token authentication

TEMS REST services provides the ability to generate a session ID (bearer token) that uniquely identifies a session and can be used for multiple requests during the session. This security method can improve response time and reduce the number of times user credentials are transferred between the client and the monitoring server. The default token expiration time is 86,400 seconds (24 hours).

You can use the GET /token endpoint to generate the bearer token.

To use bearer token authentication in a request, you must include the Authorization header containing the word Bearer and the generated token, as follows:
Authorization: Bearer token
where token is the generated token value.

If you do not include the Authorization header in the request, the request responds with status code 400 (Bad Request).

The following curl commands provide an example of how you can generate and use a bearer token:
curl -u user:password https://host:port/api/v1/token
curl -H "Authorization: Bearer token" https://host:port/api/v1/timenow
where token is the value of the token returned by the /token request in the first command.
Note: Implementation of the authorization header varies depending on the REST API tool used for the request.