This project allow Linux machines connect to VPN using openconnect with SAML authentication from G Suite.
- python3
- openconnect
- chromedriver
Please do not use higher version of openconnect then 8.05 Add this line into the file /etc/dnf/dnf.conf
excludepkgs=openconnect-8.10
Now you can install openconnect
sudo dnf install openconnect
apt-get install openconnect
First we have to install all dependence in Python3
pip3 install --user -r requirements.txt
Download latest version of chromedriver
https://chromedriver.chromium.org/downloads
Creating cache directory (this value should be set in gp-gsuite.conf)
mkdir ~/.azimo.gp
Please edit file gp-gsuite.conf and change settings:
vpn_urlif address change, by defaulthttps://vpn.azimo.comusernameyour gmail account, ex.pawel.szmuc@azimo.compasswordleave empty, I don't want know your passwordgatewaynot used at this moment, by defaultManual vpn.azimo.comwebdriverpath to binnarychromedrive(at this moment we are using chromedrive in version 73)webdriver_dirwhere all cookies should be saved, by default~/.azimo.gpopenconnect_cmdif you don't have to use root privillages can be emptyprelogin_cookieif you already knowprelogin_cookieyou can skip cookie generationopenconnect_argsextra parameters for openconnectexecute1 or true to execute, 0 for debug onlydebug1 or true for debug variablesbug.nl1 or true, newline work-around for openconnectbug.username1 or true, username work-around for openconnect
It's verrryyyyyy easy :)
./gp-gsuite.py <conf>
Example:
./gp-gsuite.py gp-gsuite.conf
- chromedrive cache (java kur12)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72),platform=Linux 5.0.5-200.fc29.x86_64 x86_64)
Solution:
rm -rf /tmp/.com.google.Chrome*