Skip to content

Instantly share code, notes, and snippets.

@kowyo
Last active October 20, 2025 05:52
Show Gist options
  • Select an option

  • Save kowyo/ddee70ad7b1e012fc4d316dcbdd4c101 to your computer and use it in GitHub Desktop.

Select an option

Save kowyo/ddee70ad7b1e012fc4d316dcbdd4c101 to your computer and use it in GitHub Desktop.
Connect to NUS VPN using 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.

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, to install openconnect-lite, run:

uv tool install openconnect-lite

Usage

openconnect-lite --server 8d0c.vpn.sse.cisco.com/NUSStudent --user <NUS_ID@Email>

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]
address = "8d0c.vpn.sse.cisco.com/NUSStudent"
user_group = ""
name = ""

[credentials]
username = "<YOUR_NUS_EMAIL>"

[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"
@kouyk
Copy link

kouyk commented Oct 6, 2025

You might want to consider simplifying the set up process with uv tool install git+https://github.com/kowyo/openconnect-sso, tbf uv should be the requirement to run this, pipx etc should have no problem with this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment