Authenticating
ChatOps uses jwt token to authenticate between chat window and Z ChatOps server. ChatOps leverages asymmetric encryption to protect information of users, you can encrypt your user information by using the public key.

Get access token
- Create a new user for your web app by using the add user API in IBM Z® ChatOps Microservice.
- Log in with the user you create by using the login API in IBM Z ChatOps Microservice.
For more information about IBM Z ChatOps Microservice, see Managing user account password of Z ChatOps Microservice.
Get user information of integrating web app
The user information of integrating web app is provides by its server in the format of
JSON{"userId": "", "username": ""}. So the backend server of the integrating web
app must provide an API to get the current user information.
- Store your authentication information
- Verify the login status of the integrating web app
- For easy use (plain text):
You can use plain text in this format directly:
{"userId": "", "username": ""} - For security (encrypted text):
The integrating web app server must provide a REST API to provide the user information in the format of
{userId: ’’, username: ‘‘}. You must encrypt the user information with the public key in RSA algorithm.To get the public key, complete the following steps:- Go the directory that you create in Step 5.
- Run the following command:
You can get the public_key.pem and private_key.pem files../generate.shNote: If the private_key.pem exists, Z ChatOps will decrypt the user information by the private key, so the first way (plain text) will not work. - Copy the public key to the integrating web app backend project, and use the key to encrypt the user information.