Search code examples
pythonvpnciscoazure-vpn

Click button in Cisco Anyconnect login prompt using Python


I am writing a Python script to auto login to my company's VPN at startup if certain network conditions are met. We use Cisco AnyConnect Secure Mobility Client to connect.

Due to the MFA method used for the vpn (Azure), I cannot use the vpncli tool that comes with Anyconnect to handle the connection. This means I need to use the vpn UI and click a "Connect" button in the prompt. enter image description here

I've seen people use Selenium for this in web browsers, but this isn't a browser prompt.

Does anyone know if there is a way to do this programmatically?

Thanks,

Josh


Solution

  • It sounds like Sikuli(X) is what you want. I haven't used it, but it seems like doing what you want with it should be relatively straightforward, as indicated by this tutorial.