User accounts and persistent sessions for simple peons.
- High performance
- Low memory footprint
- HTTP/REST service for…
- Users
- Sessions
If not already, users can register with the service at the /register
endpoint.
POST http://localhost:8081/register
Content-Type: application/json
{
"name": "chris",
"pass": "guest"
}
HTTP/1.1 200 OK Date: Wed, 17 Feb 2021 02:16:32 GMT Content-Length: 0
Once already registered, users can Authenticate using the /authenticate
endpoint with the same name and password used during registration.
POST http://localhost:8081/authenticate
Content-Type: application/json
{
"name": "chris",
"pass": "guest"
}
{
"expires": 1613621508848924782,
"token": "0a0621d8-93e4-4f06-aa06-3ab4a13e8736"
}
External services use the /authorize
endpoint to identify and authorize the user making the request.
GET http://localhost:8081/authorize
Content-Type: application/json
{
"secret": "test",
"token": "0a0621d8-93e4-4f06-aa06-3ab4a13e8736"
}
{
"userID": 1
}
When finished with their session, users can use the /logout
endpoint to end their session while it remains valid.
GET http://localhost:8081/logout
Content-Type: application/json
{
"token": "0a0621d8-93e4-4f06-aa06-3ab4a13e8736"
}
HTTP/1.1 200 OK Date: Wed, 17 Feb 2021 02:19:45 GMT Content-Length: 0