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.
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).
Authorization
header containing the word Basic, and the username:password string
encoded in Base64, as
follows:Authorization: Basic credentialswhere
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).
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.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.
Authorization header containing the word Bearer and the generated
token, as follows:Authorization: Bearer tokenwhere
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).
curl -u user:password https://host:port/api/v1/tokencurl -H "Authorization: Bearer token" https://host:port/api/v1/timenowwhere
token is the value of the token returned by the
/token request in the first command.