OpenConnect supporting Two-factor authentication (2FA) to Cisco SSL-VPNs
Project description
openconnect-lite
[!NOTE] This project is a fork of vlaci/openconnect-sso and is under development. Please report issues or start discussions in kowyo/openconnect-lite. Contributions are welcome.
Wrapper script for OpenConnect supporting Azure AD (SAMLv2) authentication to Cisco SSL-VPNs
Supported Platforms
- Linux
- macOS
- Windows
Installation
- Install
openconnecton your system
sudo apt install openconnect # Debian
brew install openconnect # macOS
scoop install main/openconnect # Windows
# For other platforms, see https://www.infradead.org/openconnect/download.html
- Install
openconnect-lite
We use uv to install this project. If you don't have uv installed, you can install it by running:
curl -LsSf https://astral.sh/uv/install.sh | sh
Then, we can run following command to install openconnect-lite
uv tool install openconnect-lite
Usage
openconnect-lite --server <vpn_server_addr> --user <your_username>
Configuration
You can customize the behavior of openconnect-lite by creating a configuration file at $HOME/.config/openconnect-lite/config.toml on Unix
and %LOCALAPPDATA%\.config\openconnect-lite\config.toml on Windows
on_disconnect = ""
[default_profile]
server = "<VPN_SERVER_ADDRESS>"
user_group = ""
name = ""
[credentials]
username = "<YOUR_USERNAME>"
[auto_fill_rules]
[[auto_fill_rules."https://*"]]
selector = "div[id=passwordError]"
action = "stop"
[[auto_fill_rules."https://*"]]
selector = "input[type=email]"
fill = "username"
[[auto_fill_rules."https://*"]]
selector = "input[name=Password]"
fill = "password"
[[auto_fill_rules."https://*"]]
selector = "input[data-report-event=Signin_Submit]"
action = "click"
[[auto_fill_rules."https://*"]]
selector = "#submitButton"
action = "click"
[[auto_fill_rules."https://*"]]
selector = "div[data-value=PhoneAppOTP]"
action = "click"
[[auto_fill_rules."https://*"]]
selector = "a[id=signInAnotherWay]"
action = "click"
[[auto_fill_rules."https://*"]]
selector = "input[name=otc]"
fill = "totp"
Adding custom openconnect arguments
Sometimes you need to add custom openconnect arguments. One situation can be if you get similar error messages:
Failed to read from SSL socket: The transmitted packet is too large (EMSGSIZE).
Failed to recv DPD request (-5)
or:
Detected MTU of 1370 bytes (was 1406)
Generally, you can add openconnect arguments after the -- separator. This is called "positional arguments". The
solution of the previous errors is setting --base-mtu e.g.:
openconnect-lite --server vpn.server.com/group --user user@domain.com -- --base-mtu=1370
Development
This project uses uv for dependency management. To set up the development environment:
# Clone and set up the project
git clone https://github.com/kowyo/openconnect-lite
cd openconnect-lite
# Create the virtual environment and install all dependency groups
make dev
uv run openconnect-lite --help
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openconnect_lite-0.8.7.tar.gz.
File metadata
- Download URL: openconnect_lite-0.8.7.tar.gz
- Upload date:
- Size: 61.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4df9410ed96394d981a3a610d69d0e2b26090ca4aaeaa104a419981a30b9fff1
|
|
| MD5 |
ed8968336d2c4571c8b0ee19fbbe796c
|
|
| BLAKE2b-256 |
b21ec986fae7d9561267676399dea98ac53cb8640befa3da7de97a479f48067a
|
File details
Details for the file openconnect_lite-0.8.7-py3-none-any.whl.
File metadata
- Download URL: openconnect_lite-0.8.7-py3-none-any.whl
- Upload date:
- Size: 29.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2764280df1b0c8e033dbb32419bf3b4fedb222fcb599e69b6ba2b505c3090f6b
|
|
| MD5 |
fe4d5792f1486c6e76b223247338a5ea
|
|
| BLAKE2b-256 |
47e5c5a0d3ebfa53faf654a86e642bc4c9e759e7cdea19cff824e5869943f702
|