File: README.HTTP_AUTHENTICATOR

package info (click to toggle)
ntopng 5.2.1%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 121,832 kB
  • sloc: javascript: 143,431; cpp: 71,175; ansic: 11,108; sh: 4,687; makefile: 911; python: 587; sql: 512; pascal: 234; perl: 118; ruby: 52; exp: 4
file content (35 lines) | stat: -rw-r--r-- 1,166 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
HTTP authentication can be enabled from the ntopng preferences page.

NTOP will request a POST to a URL with a JSON content:
{ "user": "username", "password": "password" }

User is granted if webservice return code 200, anything else
user is not granted. Content-Type and answer content are not checked.

If you want to grant a user as an administrator, webservice must
reply a JSON like:
{ "admin": true }

Some optional fields can personalize user.
You can set allowed ifname via optional allowedIfname field:
{ "allowedIfname": "ethX" }

You can set allowed network via optional allowedNets field:
{ "allowedNets": "10.0.0.0/24,192.168.0.0/16" }

You can set language via optional language field:
{ "language": "en" }

HTTP authentication parameters are discussed below.

* HTTP URL
URL to request for authentication.
Examples:
    http://server.tld/auth
    https://server.tld/auth
    http://192.168.1.1/api/auth

# Setting up a simple HTTP authenticator
The python script https://github.com/ntop/ntopng/blob/dev/tools/http_authenticator.py
shows how to implement a simple HTTP authenticator. It assumes that a `/login` path
is used to indicate the login path.