# REST API
# Authentication
The REST API of ALEX supports authentication via JSON Web Tokens (JWT) (opens new window).
Make a
POSTrequest to/rest/users/loginwith a HTTP body that contains a serialized user object which looks like:{ "email" : "<yourEmail>", "password" : "<yourPassword>" }1
2
3
4You should receive a base64 encoded JWT in a JSON object
{"token": "THEBASE64ENCODEDTOKEN"}. Save it and send it with each HTTP request to the API in the HTTP-Authorization header as follows:Authorization: Bearer THEBASE64ENCODEDTOKEN.
The token provides information about the user as a base64 encoded JSON object as payload. The payload looks like:
{
  "email": "<yourEmail>",
  "username": "<yourPassword>", 
  "id": <yourID>, 
  "role": "<yourRole>"
}
 1
2
3
4
5
6
2
3
4
5
6
← Technologies CLI →