Skip to main content

Wrapper script for OpenConnect supporting Azure AD (SAMLv2) authentication to Cisco SSL-VPNs (Fork)

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

  1. Install openconnect on 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
  1. 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 git+https://github.com/kowyo/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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openconnect_lite-0.8.5.tar.gz (62.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openconnect_lite-0.8.5-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

Details for the file openconnect_lite-0.8.5.tar.gz.

File metadata

  • Download URL: openconnect_lite-0.8.5.tar.gz
  • Upload date:
  • Size: 62.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.4

File hashes

Hashes for openconnect_lite-0.8.5.tar.gz
Algorithm Hash digest
SHA256 1b755becf0821a8dfcda1d031bdc48b90774264c862bf34c188846da8f5c05b4
MD5 2c858c0bc81f971f1ab19cb30b477b0b
BLAKE2b-256 1c3e26d3ccc10468be0326f3d442a8a67dba9fc5bb1929471ed1bdd7ca8e8ada

See more details on using hashes here.

File details

Details for the file openconnect_lite-0.8.5-py3-none-any.whl.

File metadata

File hashes

Hashes for openconnect_lite-0.8.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b94cf9c9e48abaa3ff0450e8480f69d0168a4e32f596059419d24d9a31b32e17
MD5 08f087f21b5d1d8c205d225d05b8f06e
BLAKE2b-256 e8fa3b59d0b912ec13f763414582430a54c973a5664804fded5cc85b4a76b482

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page