Results 1 to 2 of 2

Thread: Cache of Credential

  1. #1
    Join Date
    Aug 2010
    Posts
    19
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows Symbian S60 Maemo/MeeGo
    Wiki edits
    9

    Default Cache of Credential

    Hello,

    I'm using QNetworkAccessManager and connect its signal authenticationRequired to a slot which fills in the username and password to QAuthenticator object.

    According to the documentation:
    QNetworkAccessManager will cache the credentials internally and will send the same values if the server requires authentication again, without emitting the authenticationRequired() signal. If it rejects the credentials, this signal will be emitted again.
    Now, suppose that user logins. Application sends request to an URL for login (e.g. http:\\www.a.com\login) and the username and password are provided by slot of authenticationRequired ().
    The first time, the process success !!!! Of course !!

    The problem is that if user logouts, then he login again with the same username but incorrect password. Now, because the url is not changed, the username is not changed then QNetworkAccessManager won't emit authenticationRequired(). Instead, QNetworkAccessManager retrieve the last password (the first password) and send it to the server. And because the cached password is correct, the user can login with an incorrect password. This is completely wrong.

    Is there any idea how to solve the problem?

    Thanks a lot

    Hai

  2. #2
    Join Date
    Sep 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Cache of Credential

    Quote Originally Posted by lyhoanghai View Post
    Hello,

    The problem is that if user logouts, then he login again with the same username but incorrect password. Now, because the url is not changed, the username is not changed then QNetworkAccessManager won't emit authenticationRequired(). Instead, QNetworkAccessManager retrieve the last password (the first password) and send it to the server. And because the cached password is correct, the user can login with an incorrect password. This is completely wrong.

    Is there any idea how to solve the problem?

    Thanks a lot

    Hai
    This is a bug. For example, similar bug was reported here: http://bugreports.qt.nokia.com/browse/QTBUG-15566.
    I think you should report about your problem to Qt's bug tracker.

Similar Threads

  1. Replies: 4
    Last Post: 13th July 2010, 21:04
  2. Clear a cache!
    By Indalo in forum Qwt
    Replies: 1
    Last Post: 5th March 2010, 16:59
  3. using QWebView cache with QNetworkDiskCache
    By Jann3 in forum Qt Programming
    Replies: 3
    Last Post: 7th October 2009, 13:23
  4. Replies: 3
    Last Post: 12th July 2008, 22:51
  5. deleting plugin cache entries (qsqlmysql.lib )
    By locus in forum Qt Programming
    Replies: 1
    Last Post: 20th June 2007, 16:41

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.