russdill / juniper-vpn-py

Python Juniper VPN Authenticator
GNU Lesser General Public License v2.1
103 stars 80 forks source link

Fails to connect when there is a pre sign-in agreement #19

Open macthecadillac opened 8 years ago

macthecadillac commented 8 years ago

I was trying to connect to my school vpn but my school vpn has a page that loads that makes you agree to the usage agreement before the actual sign-in page loads. I tried connecting following instructions exactly but it raises an error. Here is the traceback:

Password: Traceback (most recent call last): File "./juniper-vpn.py", line 357, in jvpn.run() File "./juniper-vpn.py", line 165, in run self.action_login() File "./juniper-vpn.py", line 213, in action_login self.br.form['username'] = self.args.username File "/usr/lib/python2.7/dist-packages/mechanize/_form.py", line 2780, in setitem control = self.find_control(name) File "/usr/lib/python2.7/dist-packages/mechanize/_form.py", line 3101, in find_control return self._find_control(name, type, kind, id, label, predicate, nr) File "/usr/lib/python2.7/dist-packages/mechanize/_form.py", line 3185, in _find_control raise ControlNotFoundError("no control matching "+description) mechanize._form.ControlNotFoundError: no control matching name 'username' Terminated

If there's anything else that needs to be provided for the issue to be resolved, I'd be happy to help. Thanks.

animetrics commented 7 years ago

This is a problem for me as well. Any work around?

animetrics commented 7 years ago

oh, I see that there is a pull request that may resolve this?

rbeede commented 7 years ago

I have modified a copy of the code to fix the problem. Their is a cookie missing DSSigninNotif=1 that signals to go past the screen. Annoying too is the html form still says frmLogin which confuses the tool.

I will try to post the fix today as a pull request.

rbeede commented 7 years ago

Nevermind, this pull request is better.

https://github.com/russdill/juniper-vpn-py/pull/17/files