Auth
GET /auth/token
It returns a JWT token, its expiration and the user information.
Important: The returned token (JWT <token>) is needed for the protected endpoints. It's expected in the Authorization header as Bearer <token>
Headers parameters:
x-auth-username(mandatory): User's email.x-auth-password(mandatory): User's password.
Example response:
{
"token": "JWT eyJ0eXAiOiJKV1QiLCJhbG...",
"expires_in": 93600,
"user": {
"id": 1,
"fullname": "John McClane",
"email": "mcclane@broccoli.com",
"last_login": "2018-01-29T22:21:48Z",
"profile": 1
}
}
GET /auth/token/renew
It returns a new JWT token, its expiration and the user information.
Headers parameters:
Authorization(mandatory): User's token asBearer <token>.
Example response:
{
"expires_in": 900,
"token": "JWT eyJ0eXAiOiJKV1QiLC...",
"user": {
"email": "admin@broccoli.com",
"id": 4,
"name": "Sr",
"profile": "Administrator",
"surname": "Admin",
"username": "admin"
}
}