-
Notifications
You must be signed in to change notification settings - Fork 26
2.1) Requests: Authentication
Marco Cesarato edited this page Apr 9, 2019
·
1 revision
Authentication needed for browse the database.
The authentication permit to managed the privilege of the users (read, write, modify, delete)
- Authentication:
/auth/[password]/[id].[format]
Request example:
GET /auth/password/1265.json HTTP/1.1
Host: localhost
Response example:
[{"token": "b279fb1d0708ed81e7a194e0c5d928b6"}]
Example of token usage on GET, POST, PUT and DELETE requests:
GET /bfee499dfa1387648ec8ce9d621db120/database/users.json` HTTP/1.1
Host: localhost
Check authentication check is needed for verify if a token is valid.
- Check authentication:
/auth/check/[token].[format]
Request example:
GET /auth/check/bfee499dfa1387648ec8ce9d621db120.json HTTP/1.1
Host: localhost
Response example:
{
"user": {
"id": "1",
"role_id": "",
"is_admin": true
},
"response": {
"status": 200,
"message": "OK"
}
}