elwig-backend: Add /auth endpoint
This commit is contained in:
59
README.md
59
README.md
@ -11,6 +11,65 @@ Authorization
|
||||
-------------
|
||||
|
||||
All API endpoints are secured via an HTTP basic authentication.
|
||||
Additionally, the `/auth` endpoint may be used to obtain a Bearer/JWT token.
|
||||
|
||||
|
||||
### `GET /auth`
|
||||
|
||||
#### Example
|
||||
|
||||
```http
|
||||
GET /auth HTTP/1.1
|
||||
Host: example.com
|
||||
Accept: application/json
|
||||
Authorization: Basic dGVzdDp0ZXN0
|
||||
```
|
||||
|
||||
```http
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json; charset=UTF-8
|
||||
Content-Length: 185
|
||||
Access-Control-Allow-Origin: *
|
||||
Access-Control-Allow-Headers: Authorization
|
||||
Access-Control-Allow-Methods: HEAD, GET, POST, OPTIONS
|
||||
|
||||
```
|
||||
|
||||
### `POST /auth`
|
||||
|
||||
#### Example
|
||||
|
||||
```http
|
||||
POST /auth HTTP/1.1
|
||||
Host: example.com
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
Content-Length: 44
|
||||
|
||||
```
|
||||
|
||||
```http
|
||||
POST /auth HTTP/1.1
|
||||
Host: example.com
|
||||
Accept: application/json
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Content-Length: 31
|
||||
|
||||
username=test&password=password
|
||||
```
|
||||
|
||||
```http
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/json; charset=UTF-8
|
||||
Content-Length: 185
|
||||
Access-Control-Allow-Origin: *
|
||||
Access-Control-Allow-Headers: Authorization
|
||||
Access-Control-Allow-Methods: HEAD, GET, POST, OPTIONS
|
||||
|
||||
```
|
||||
|
||||
|
||||
Base Data
|
||||
---------
|
||||
|
||||
### `GET /wine/varieties`
|
||||
|
Reference in New Issue
Block a user