Skip to content
ebotoevaPublic

About

command line client for GlobalProtect with SSO for Mac OS

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

gpmac — macOS GlobalProtect SAML VPN client

A small, native-macOS client for GlobalProtect VPNs that authenticate with SAML SSO (e.g. a Microsoft/Azure tenant). It avoids the official GlobalProtect app and the GTK-based gpclient: login happens in a native WebKit window, and the tunnel is brought up by openconnect.

Built and tested against vox.kent.ac.uk (University of Kent).

How it works

  1. ssl-vpn/prelogin.esp → returns the SAML sign-in URL.
  2. A native WebKit window opens; you complete the Microsoft SSO login. The client captures the prelogin-cookie from the SAML ACS response headers.
  3. ssl-vpn/login.esp (with the jnlpReady flag, which makes PAN-OS treat us as a real VPN client) exchanges that for the gateway authcookie.
  4. The authcookie is handed to openconnect --protocol=gp, which establishes the ESP tunnel.

Install

git clone <this-repo> ~/.software/gpmac      # or copy the folder
cd ~/.software/gpmac
./install.sh

install.sh installs Homebrew (if missing), openconnect, and uv, then builds the Python virtualenv with the required pyobjc WebKit packages.

Usage

Run from a real terminal — it needs sudo (a TTY for the password prompt) for openconnect, and a GUI session for the login window. It will not work from a non-interactive/headless shell.

./gpmac vpn.example.edu     # connect to your portal/gateway
./gpmac vpn.example.edu -v  # verbose protocol/debug output
./gpmac vpn.example.edu --portal-config  # also fetch portal policy (2nd login; rarely needed)

The portal hostname is a required argument. To avoid typing it every time, set a default in your shell profile:

export GP_PORTAL=vpn.example.edu   # then just run: ./gpmac

Press Ctrl-C to disconnect; openconnect tears the tunnel down cleanly.

Put it on your PATH to run it as just gpmac from anywhere:

ln -s ~/.software/gpmac/gpmac "$(brew --prefix)/bin/gpmac"

Requirements

  • macOS (uses the system WebKit framework)
  • Homebrew · openconnect · uv
  • Python 3.10+ with pyobjc-framework-Cocoa and pyobjc-framework-WebKit (installed automatically into the venv by install.sh)

Notes & known-benign warnings

  • route: ... Can't assign requested address for the tunnel's own IP — harmless; the real subnet routes still get added.
  • Gateway says HIP report submission is needed — the gateway asks for a Host Information Profile report. If the portal doesn't enforce it (Kent doesn't), connectivity works fine. If some internal hosts are unreachable while others work, that's the time to look into a --csd-wrapper HIP script.
  • The portal phase (--portal-config) requires a second SAML login and is not needed to bring up the tunnel, so it's off by default.

About

command line client for GlobalProtect with SSO for Mac OS

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages