vlaci / openconnect-sso

Wrapper script for OpenConnect supporting Azure AD (SAMLv2) authentication to Cisco SSL-VPNs
GNU General Public License v3.0
300 stars 131 forks source link

Fix openconnect-sso running under windows #96

Closed alyssadev closed 2 years ago

alyssadev commented 2 years ago

At least when using scoop to install sudo. I'm not sure if others use other methods to have a working system for sudo on windows

Beej126 commented 2 years ago

i'm curious what people think about eliminating the sudo execution under Windows and just running the initial openconnect-sso process as elevated so it's subsequent launch of openconnect.exe will also be elevated.

i started capturing Windows specifics like this under a fork in case it helps others... also ready to align with anywhere else this has already been done and eliminate my extra noise.

as an aside, here's my favorite sudo for Windows... it's a pretty slick approach of capturing stdin/out of the hidden elevated process and piping that back to your initial console so it looks more like what we're used to on linux... works well in general but in this case, sending CTRL-C/SIGNINT to openconnect.exe is important for cleanup after disconnect and it doesn't seem to pass that through... could probably be coded, i'm assuming the author just didn't consider it yet.

alyssadev commented 2 years ago

Very cool changes you've got there. I'd be in favour of pulling some of those, my change is pretty half-baked, it works in my case but isn't much use outside of that