Qt World Summit: Register Today!

Auto log in feature

  • Hello everyone,

    I was wondering is there any way that i can auto log into a website having stored my username and password?
    For example, if i want to log into facebook, i have a webview nad webdialog that brings me into the sign in page for facebook, how do i manipute the webpage with QT in order to have it automatically type in my password and user name? Thank you so much!

  • @GCDX
    The usual way of getting as far as filling in controls (like username/password) on a web page is via cookies. For a QWebView see http://www.qtcentre.org/threads/21331-How-to-enable-cookie-in-QWebView and http://doc.qt.io/qt-5/qnetworkaccessmanager.html#setCookieJar.

    If you want to go further and actually auto-login (without pressing a button), you'd probably have to look at either manipulating the page (via JavaScript) to do an auto-submit with the controls pre-filled-in, or see if your target web page has a URL syntax or similar to allow username/password credentials to be passed directly by-passing the logon screen.

Log in to reply