]> code.communitydata.science - nu-vpn-proxy.git/blob - README.md
we have reports of prelogin-cookie used for portal login; don't do interface switcher...
[nu-vpn-proxy.git] / README.md
1 gp-saml-gui
2 ===========
3
4 This is a helper script to allow you to interactively login to a GlobalProtect VPN
5 that uses SAML authentication.
6
7 Interactive login is, unfortunately, sometimes a necessary alternative to automated
8 login via scripts such as
9 [zdave/openconnect-gp-okta](https://github.com/zdave/openconnect-gp-okta).
10
11 Installation
12 ============
13
14 gp-saml-gui uses GTK, which requires Python 3 bindings.
15
16 On Debian / Ubuntu, these are packaged as `python3-gi`, `gir1.2-gtk-3.0`, and
17 `gir1.2-webkit2-4.0`:
18
19 ```
20 $ sudo apt install python3-gi gir1.2-gtk-3.0 gir1.2-webkit2-4.0
21 ```
22
23 Then, set up a virtual environment that can access these system packages,
24 activate it, and install the Python dependencies:
25
26 ```
27 $ virtualenv --python=python3 --system-site-packages venv
28 $ . venv/bin/activate
29 $ pip install requests
30 ```
31
32 How to use
33 ==========
34
35 Specify the GlobalProtect server URL (portal or gateway) and optional
36 arguments, such as `--clientos=Windows` (because many GlobalProtect
37 servers don't require SAML login, but apparently omit it in their configuration
38 for OSes other than Windows).
39
40 This script will pop up a [GTK WebKit2 WebView](https://webkitgtk.org/) window.
41 After you succesfully complete the SAML login via web forms, the script will output
42 `HOST`, `USER`, `COOKIE`, and `OS` variables in a form that can be used by
43 [OpenConnect](http://www.infradead.org/openconnect/juniper.html)
44 (similar to the output of `openconnect --authenticate`):
45
46 ```sh
47 $ eval $( gp-saml-gui.py --clientos=Windows vpn.company.com )
48 Got SAML POST content, opening browser...
49 Finished loading about:blank...
50 Finished loading https://company.okta.com/app/panw_globalprotect/deadbeefFOOBARba1234/sso/saml...
51 Finished loading https://company.okta.com/login/sessionCookieRedirect...
52 Finished loading https://vpn.qorvo.com/SAML20/SP/ACS...
53 Got SAML relevant headers, done: {'prelogin-cookie': 'blahblahblah', 'saml-username': 'foo12345@corp.company.com', 'saml-slo': 'no', 'saml-auth-status': '1'}
54
55 SAML response converted to OpenConnect command line invocation:
56
57     echo 'blahblahblah' |
58         openconnect --protocol=gp --user='foo12345@corp.company.com' --os=win --usergroup=prelogin-cookie:gateway --passwd-on-stdin vpn.company.com
59
60 $ echo $HOST; echo $USER; echo $COOKIE; echo $OS
61 https://vpn.company.com/gateway:prelogin-cookie
62 foo12345@corp.company.com
63 blahblahblah
64 win
65
66 $ echo "$COOKIE" | openconnect --protocol=gp -u "$USER" --os="$OS" --passwd-on-stdin "$HOST"
67 ```
68
69 TODO
70 ====
71
72 * Packaging
73
74 License
75 =======
76
77 GPLv3 or newer

Community Data Science Collective || Want to submit a patch?