add authentication

This commit is contained in:
Martin
2016-05-11 16:05:42 +02:00
parent f41a16f041
commit 9ced739ef6
3 changed files with 28 additions and 3 deletions
+9 -1
View File
@@ -28,7 +28,15 @@ List of available configuration options:
| Name | Description |
| ---- | ----------- |
| `SQLALCHEMY_DATABASE_URI` | Database connection string. e.g: `postgresql://user:password@localhost/photowall` |
| `DEBUG` | Enable/disable debug mode
| `DEBUG` | Enable/disable debug mode |
| `API_KEYS` | A list of api keys that are used to authenticate to the API
## Authentication
Authentication to the API is performed via HTTP Basic Auth. The user should provide her API key as the basic auth username parameter. An example request in cURL looks like this (adding a colon after the username prevents cURL from asking for a password):
```
$ curl http://localhost:5000/designers/ -u mykey:
```
API keys should be added to the `API_KEYS` configuration option
## Getting started