Dbus support ?
On dlenski's github repository we see that we can create a script to generate the cookie (for example, see https://github.com/dlenski/openconnect/issues/116 for discussion of Okta/SAML wrapper scripts).
However with PingID I need to generate the cookie 2 times (one for prelogin, one for login after authgroup is chosen). To get that working the python script should look at openconnect output, it's not reliable and not easy to code.
I think using dbus to delegate authentication could be a good solution.
I made my POC, you can see here https://github.com/gaellalire/openconnect/pull/1/files
It needs to be cleaned and corrected (the dbus response is only printed, it should be used).
Attached the ping-authenticator.py ping-authenticator.py
and the /etc/dbus-1/system.d/openconnect.conf to get dbus working openconnect.conf