diff --git a/authserver/README.md b/authserver/README.md index e89bd63..a9fc632 100644 --- a/authserver/README.md +++ b/authserver/README.md @@ -15,7 +15,29 @@ $ . env/bin/activate ## API -The API is RESTful and returns hyperlinked json data. URLs require a trailing slash. +The API is RESTful and returns hyperlinked json data. **URLs require a trailing slash.** + +### Authentication + +Authentication is token-based and done against the Protospace member portal. Upon successful login, the auth server will automatically register the user and create them a profile. + +#### POST `/login/` + +POST data `username` and `password`. Upon successful login, a 200 status and a token will be returned. + +Example response: + +``` +{ + "token": "9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b" +} +``` + +In subsequent requests, the token key should be included in the `Authorization` HTTP header. The key should be prefixed by the string literal "Token", with whitespace separating the two strings. For example: + +``` +Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b +``` ### For anonymous users