]> www.infradead.org Git - users/dwmw2/openconnect.git/commit
add test-fortinet-login.py
authorDaniel Lenski <dlenski@gmail.com>
Wed, 13 May 2020 21:29:41 +0000 (14:29 -0700)
committerDaniel Lenski <dlenski@gmail.com>
Wed, 13 May 2020 21:29:41 +0000 (14:29 -0700)
commit2c67245261e7f9d7616ef6c6a8af3dd8a2ed13a1
tree33e4e37c43fa77b76f29d451213c944b431f77ff
parent05c82e7d83362aba2194227406eaef8ae5090e51
add test-fortinet-login.py

Often easier to prototype HTTPS-based authentication flows in Python, since
they're so fiddly and arbitary.  So I copied `test-f5-login.py` to
`test-fortinet-login.py`.  Currently only handles basic
username-and-password auth, no 2FA:

```
usage: test-fortinet-login.py [-h] [-v] [-u USERNAME] [-p PASSWORD] [-r REALM]
                              [-c CERT] [--key KEY] [--no-verify]
                              endpoint [extra [extra ...]]

positional arguments:
  endpoint              Fortinet server (or complete URL, e.g.
                        https://forti.vpn.com/remote/login)
  extra                 Extra field to pass to include in the login query
                        string (e.g. "foo=bar")

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose
  --no-verify           Ignore invalid server certificate

Login credentials:
  -u USERNAME, --username USERNAME
                        Username (will prompt if unspecified)
  -p PASSWORD, --password PASSWORD
                        Password (will prompt if unspecified)
  -r REALM, --realm REALM
                        Realm (empty if unspecified)
  -c CERT, --cert CERT  PEM file containing client certificate (and optionally
                        private key)
  --key KEY             PEM file containing client private key (if not
                        included in same file as certificate)
```

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
test-fortinet-login.py [new file with mode: 0755]