{"action":"created","issue":{"url":"https://api.github.com/repos/OpenVPN/openvpn-gui/issues/227","repository_url":"https://api.github.com/repos/OpenVPN/openvpn-gui","labels_url":"https://api.github.com/repos/OpenVPN/openvpn-gui/issues/227/labels{/name}","comments_url":"https://api.github.com/repos/OpenVPN/openvpn-gui/issues/227/comments","events_url":"https://api.github.com/repos/OpenVPN/openvpn-gui/issues/227/events","html_url":"https://github.com/OpenVPN/openvpn-gui/issues/227","id":303685129,"number":227,"title":"Password field is blank after session expiration","user":{"login":"NullSquatch","id":36282772,"avatar_url":"https://avatars1.githubusercontent.com/u/36282772?v=4","gravatar_id":"","url":"https://api.github.com/users/NullSquatch","html_url":"https://github.com/NullSquatch","followers_url":"https://api.github.com/users/NullSquatch/followers","following_url":"https://api.github.com/users/NullSquatch/following{/other_user}","gists_url":"https://api.github.com/users/NullSquatch/gists{/gist_id}","starred_url":"https://api.github.com/users/NullSquatch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NullSquatch/subscriptions","organizations_url":"https://api.github.com/users/NullSquatch/orgs","repos_url":"https://api.github.com/users/NullSquatch/repos","events_url":"https://api.github.com/users/NullSquatch/events{/privacy}","received_events_url":"https://api.github.com/users/NullSquatch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-09T00:45:09Z","updated_at":"2018-03-09T20:32:04Z","closed_at":null,"author_association":"NONE","body":"# Main Issue\r\n\r\nTo provide some background, the server I connect to uses `static-challenge`.  I prefer to leave my connection active during the day and put my workstation into sleep mode each night.  When I wake my workstation the next morning, the OpenVPN connection is no longer active and I'm presented with an authentication popup.  This by itself is not an issue.\r\n\r\nThe problem is that the `Password` field on the popup is blank, despite the fact that I have the `Save password` option enabled.  I would only expect `Password` to be blank if the authentication failure was specifically due to an incorrect username/password.\r\n\r\nThe client log shows these relevant lines:\r\n\r\n```\r\nMANAGEMENT: >STATE:1520524314,GET_CONFIG,,,,,,\r\nSENT CONTROL [OpenVPN Server]: 'PUSH_REQUEST' (status=1)\r\nAUTH: Received control message: AUTH_FAILED,SESSION: Your session has expired, please reauthenticate\r\nSIGUSR1[soft,auth-failure] received, process restarting\r\nMANAGEMENT: >STATE:1520524314,RECONNECTING,auth-failure,,,,,\r\n```\r\n\r\nThis shows that the session expired, so it makes sense that the popup is being displayed.   If I had to guess, I'd say that the GUI code isn't differentiating between session expiration failures and failures caused by an incorrect username/password.\r\n\r\n# Additional Observations\r\n\r\n1) In this particular situation, the cursor is in the `Password` field, but I would expect the cursor to instead be in the `Response` field, as that is the field that requires new input in order to successfully connect.\r\n1) In this particular situation, the bottom of the dialog does not state the reason for the previous disconnection.  I would expect it to show the reason returned by the server, i.e. `Your session has expired, please reauthenticate`.\r\n1) If I happen to enter the correct username and password but use an incorrect value for the `Response` field, the dialog clears the `Password` field and shows `Wrong username or password. Try again...` at the bottom of the popup, despite the log showing that the reason for the failure was `AUTH: Received control message: AUTH_FAILED,Google Authenticator Code is incorrect`.  I would expect this to be handled similar to session expiration, i.e. the `Password` field should not be cleared, the cursor should be in an empty `Response` field, and the message at the bottom should read `Google Authenticator Code is incorrect`."},"comment":{"url":"https://api.github.com/repos/OpenVPN/openvpn-gui/issues/comments/371937219","html_url":"https://github.com/OpenVPN/openvpn-gui/issues/227#issuecomment-371937219","issue_url":"https://api.github.com/repos/OpenVPN/openvpn-gui/issues/227","id":371937219,"user":{"login":"NullSquatch","id":36282772,"avatar_url":"https://avatars1.githubusercontent.com/u/36282772?v=4","gravatar_id":"","url":"https://api.github.com/users/NullSquatch","html_url":"https://github.com/NullSquatch","followers_url":"https://api.github.com/users/NullSquatch/followers","following_url":"https://api.github.com/users/NullSquatch/following{/other_user}","gists_url":"https://api.github.com/users/NullSquatch/gists{/gist_id}","starred_url":"https://api.github.com/users/NullSquatch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NullSquatch/subscriptions","organizations_url":"https://api.github.com/users/NullSquatch/orgs","repos_url":"https://api.github.com/users/NullSquatch/repos","events_url":"https://api.github.com/users/NullSquatch/events{/privacy}","received_events_url":"https://api.github.com/users/NullSquatch/received_events","type":"User","site_admin":false},"created_at":"2018-03-09T20:32:04Z","updated_at":"2018-03-09T20:32:04Z","author_association":"NONE","body":">Anyway, currently there are on going efforts to improve AUTH_FAILURE reporting in OpenVPN core so we are going to improve the GUI too in this regard.\r\n\r\nThat sounds promising.  Ideally those future improvements will work in favor of anyone in my situation.  Since you mentioned that most servers probably won't want to send detailed auth failure reasons, I have my doubts as to how much those improvement will help.\r\n\r\nIn the meantime, allow me to propose a simple alternative.  Always prefill the `Password` field when possible (including on auth failures), but have all the password's characters selected with the cursor at the end of the selection.  This implicitly gives the user the option to either press tab/enter to continue using it or to just start typing (which automatically deletes the selected characters).\r\n\r\nIf this behavior is too controversial, it could be toggled by a new config option."}}
{"actor":{"display_login":"NullSquatch"}}