OpenConnect wrapper with Azure AD (SAML) SSO support for Cisco SSL-VPNs
Project description
openconnect-saml
OpenConnect wrapper supporting Azure AD / SAML authentication for Cisco AnyConnect SSL-VPNs.
Modernized fork based on vlaci/openconnect-sso with improvements from kowyo/openconnect-lite.
Features
- SAML / Azure AD authentication via embedded Qt WebEngine browser
- Automatic form-filling for username, password, and TOTP
- Password stored in system keyring (with in-memory fallback)
- TOTP secret configurable directly in config file
- Profile auto-detection from AnyConnect XML profiles
- Proxy support (SOCKS/HTTP)
- Client certificate handling (auto-fallback on cert-request)
--no-sudomode for use with--script-tun--csd-wrapperpassthrough for CSD/hostscan support--reset-credentialsto clear saved keyring entries- Microsoft Authenticator number matching support
- Office365 "Stay signed in?" auto-dismiss
- Robust XML parsing (recovers from malformed responses)
Requirements
- Python ≥ 3.10
- OpenConnect installed and in PATH
- Qt6 WebEngine (provided by PyQt6)
Installation
# Recommended: install as isolated tool
uv tool install openconnect-saml
# Or via pip
pip install openconnect-saml
Usage
# Connect to a VPN server
openconnect-saml --server vpn.example.com
# With a specific user group
openconnect-saml --server vpn.example.com/usergroup
# Use AnyConnect profile
openconnect-saml --profile /opt/cisco/anyconnect/profile
# Authentication only (output cookie)
openconnect-saml --server vpn.example.com --authenticate
# Without sudo (for --script-tun)
openconnect-saml --server vpn.example.com --no-sudo -- --script-tun
# With CSD hostscan wrapper
openconnect-saml --server vpn.example.com --csd-wrapper /path/to/csd-wrapper.sh
# Reset saved credentials
openconnect-saml --user user@example.com --reset-credentials
Configuration
Config file: $HOME/.config/openconnect-saml/config.toml
[default_profile]
address = "vpn.example.com"
user_group = ""
name = "My VPN"
[credentials]
username = "user@example.com"
# Optional: run a command on disconnect
on_disconnect = ""
Auto-fill rules
Custom auto-fill rules can be defined per URL pattern:
[auto_fill_rules]
"https://*" = [
{ selector = "input[type=email]", fill = "username" },
{ selector = "input[name=passwd]", fill = "password" },
{ selector = "input[id=idTxtBx_SAOTCC_OTC]", fill = "totp" },
]
Office365 "Stay signed in?" page
The default rules now auto-dismiss the "Stay signed in?" prompt. If you use custom auto_fill_rules, add these entries:
[[auto_fill_rules."https://*"]]
selector = "input[id=KmsiCheckboxField]"
action = "click"
[[auto_fill_rules."https://*"]]
selector = "input[id=idSIButton9]"
action = "click"
TOTP / Password
Credentials are stored in the system keyring. On first use, you'll be prompted for your password and optional TOTP secret.
If keyring is unavailable (e.g., headless server), passwords are kept in memory for the session.
To clear stored credentials:
openconnect-saml --user user@example.com --reset-credentials
Credits
Based on vlaci/openconnect-sso by László Vaskó, with improvements from kowyo/openconnect-lite.
License
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_saml-0.1.0.tar.gz.
File metadata
- Download URL: openconnect_saml-0.1.0.tar.gz
- Upload date:
- Size: 37.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b415191d9f585f31f857deaec0d77d150aeb19a879ad55eee4ac22aa5000b59
|
|
| MD5 |
10c165cabda23d037870ac0b41517f91
|
|
| BLAKE2b-256 |
51280665ef8a39ba3c6be38be5c9b0cc73ceee1d34f59b0625018f91da1bd5d0
|
Provenance
The following attestation bundles were made for openconnect_saml-0.1.0.tar.gz:
Publisher:
publish.yml on mschabhuettl/openconnect-saml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openconnect_saml-0.1.0.tar.gz -
Subject digest:
2b415191d9f585f31f857deaec0d77d150aeb19a879ad55eee4ac22aa5000b59 - Sigstore transparency entry: 1201116548
- Sigstore integration time:
-
Permalink:
mschabhuettl/openconnect-saml@4967bb58ac2639c0b7ae1fad9a11605497be25f5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mschabhuettl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4967bb58ac2639c0b7ae1fad9a11605497be25f5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file openconnect_saml-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openconnect_saml-0.1.0-py3-none-any.whl
- Upload date:
- Size: 33.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4368fc09db81d6bd2a7893d90dcd2d30ce6ae4d1b116e70a201c01f58fcf717
|
|
| MD5 |
d2f9edb578edb855218d0a8a27194c43
|
|
| BLAKE2b-256 |
c197454074f492272a024da42b1cfbb54404484f2335361bfde7a6641aa7cfbe
|
Provenance
The following attestation bundles were made for openconnect_saml-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on mschabhuettl/openconnect-saml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openconnect_saml-0.1.0-py3-none-any.whl -
Subject digest:
c4368fc09db81d6bd2a7893d90dcd2d30ce6ae4d1b116e70a201c01f58fcf717 - Sigstore transparency entry: 1201116549
- Sigstore integration time:
-
Permalink:
mschabhuettl/openconnect-saml@4967bb58ac2639c0b7ae1fad9a11605497be25f5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mschabhuettl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4967bb58ac2639c0b7ae1fad9a11605497be25f5 -
Trigger Event:
push
-
Statement type: