From 8c6a4dcbe635ccd16532ad1d7aa59dc7f3af9545 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sat, 15 Sep 2018 21:25:39 -0600 Subject: [PATCH] Add authentication info to README --- authserver/README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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