Is there anyway to get this to work with 2-way-auth?

When i login to my companies vpn via their website i first enter my Username, then after a while i get a sms with password i enter that in to the site and pair with my personal-pin and then I am logged in and can start the client.

When i try to use the script i get prompted for a password directly when i try to login, so i guess no request is sent to the server so I dont get any password sms, but if i enter a "fake" password i get the password sms, but now i cant enter a password becouse i already used a fake one. So it seams to be kind of working but I would need the script to send a login request before password prompt and after that send the real login request.

Anyone got this working with a simular setup?