Authentication
For authentication of user, API responses JWT token that stores in the HTTP header
.
Type of JWT Token is Bearer
Log In
# Auhtenticate user`POST`
http://localhost:8080/login
HTTP/1.1
Request
Content-Type : application/json
{
"email" : "test@email.com",
"password" : "user-password",
}
Response
Success:
Authorization : Bearer {jwt.token}
{
"status" : 200,
"success" : "true",
}
Error:
{
"timestamp" : "2018-05-24T12:44:26.295+0000",
"status" : 403,
"error" : {
"message" : "Forbidden"
},
"success" : "false",
"path" : "/login"
}
Log Out
# Auhtenticate user`GET`
http://localhost:8080/{userId}/logout
HTTP/1.1
Request
Authorization : Bearer {jwt.token}
Content-Type : application/json
Response
Success:
{
"status": 204,
"success": "true",
}
Error:
{
"timestamp" : "2018-05-24T12:44:26.295+0000",
"status" : 500,
"error" : {
"message" : "Internal error"
},
"success" : "false",
"path" : "/api/user/all"
}