1934
|
1 --- |
|
2 summary: HTTP Authentication using custom JSON protocol |
|
3 ... |
|
4 |
|
5 Introduction |
|
6 ============ |
|
7 |
|
8 To authenticate users, this module does a `POST` request to a configured |
|
9 URL with a JSON payload. It is not async so requests block the server |
|
10 until answered. |
|
11 |
|
12 Configuration |
|
13 ============= |
|
14 |
|
15 ``` lua |
|
16 VirtualHost "example.com" |
|
17 authentication = "custom_http" |
|
18 auth_custom_http = "http://api.example.com/auth" |
|
19 ``` |
|
20 |
|
21 Protocol |
|
22 ======== |
|
23 |
|
24 The JSON payload consists of an object with `username` and `password` |
|
25 members: |
|
26 |
|
27 {"username":"john","password":"secr1t"} |
|
28 |
|
29 The module expects the response body to be exactly `true` if the |
|
30 username and password are correct. |