Open bjornarfjelldal opened 2 years ago
I got the same exect same error, but managed to get it to work after importing the anyconnect profile using
openconnect-sso -p /opt/cisco/anyconnect/profile/VPNprofile.xml
I think the only difference is that I didn't specify usergroup manually. Running in an ubuntu docker, authenticating via microsoft 365 two-factor.
edit: I get error message on the first run, second run it connects..
For us in our organization we had to stop passing the username in the cli as Azure does a stricter check apparently.
Also make sure you have the username removed/commented from .config/openconnect-sso/config.toml
Thanks @sam-sla ! The solution works for me.
A further look seems to indicate my organization (or Azure) now checks how quickly the "sign in" button is clicked. If it's too quickly, the authentication fails. In my case, I managed to work around it by replacing the following lines in ~/.config/openconnect-sso/config.toml
[[auto_fill_rules."https://*"]]
selector = "input[type=submit]"
action = "click"
with
[[auto_fill_rules."https://*"]]
selector = "input[value=Next]"
action = "click"
[[auto_fill_rules."https://*"]]
selector = "input[value=Yes]"
action = "click"
so that the saved username and password still work, only the "sign in" button needs to be clicked manually.
In case someone would like to automate the authentication process before the official fix is out, another workaround is to add a delay before clicking the "sign in" button:
to:
f"""var elem = document.querySelector({selector}); if (elem) {{ var click_delay=0; if (elem.value == "Sign in") {{click_delay = 1000;}} elem.dispatchEvent(new Event("focus")); setTimeout(function() {{ elem.click(); }}, click_delay); }}"""
Running
openconnect-sso --server vpnserver --user myuser -l debug
Goes through SSO with autocomplete user/password - and after completing 2FA verification, this happens:
I tried some tips from #57 without any luck, namely
https://github.com/vlaci/openconnect-sso/issues/57#issuecomment-854768168
and
https://github.com/vlaci/openconnect-sso/issues/57#issuecomment-854466649
Since the error message is different, I open a new issue.
Running this on MacOS Big Sur 12.5.
Any tips?