-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autofilled fields not accepted until modified "by hand" #31
Comments
I can see that happening as I not fill the form in the exact same way as a browser would: https://github.com/vlaci/openconnect-sso/blob/master/openconnect_sso/browser/webengine_process.py#L170 I am far from being a javascript expert but I can imagine that firing some additional event would fix the issue. It is no webkit issue as the browser actually chromium based. I peeked into how an actual browser plugin does form filling. Browserpass for example has some additional incantations: https://github.com/browserpass/browserpass-extension/blob/master/src/inject.js#L435 |
@vlaci thanks! I can confirm that using this update function makes it work with Okta |
@vlaci I can also verify that an additional event is needed for okta-based login screens. I tested that adding the change event is enough to make it work. Just replace this statements.append call with the following: statements.append(
f"""var elem = document.querySelector({selector}); if (elem) {{ elem.dispatchEvent(new Event("focus")); elem.value = {value};
// okta: additional event is needed, see issue #31
elem.dispatchEvent(new Event("change", {{bubbles:true}}));
elem.dispatchEvent(new Event("blur")); }}"""
)
Could we change it like this in the repo? |
Additional note: also saw that pull request #142 contains similar tweaks in its first commit. |
When autofilling, the form displays the errors "Please enter a username" and "Please enter a password". If I modify the field (e.g., type a space at the end and then delete it), then the values that were autofilled are accepted. I had similar problems when remembering passwords with epiphany (same okta implementation), so it may be a webkit issue. The okta server in question is http://okta.nd.edu. Is this fixable in openconnect-sso, or do I need to report upstream?
The text was updated successfully, but these errors were encountered: