[Interest] QNetworkAccessManager - how to enforce authentication?

Alex Malyushytskyy alexmalvtk at gmail.com
Thu Aug 9 04:34:28 CEST 2012

I could not find how to enforce authentication of QNetworkAccessManager.

Problem is that for at least http server I have go work with,
when user specify a valid user name, but invalid password
when requested for authentication first time,

user will not be requested for authentication second time,
instead  QNetworkReply signal finished() is emitted with error
"Connection closed".

It would be okay, but next time request is started signal
authenticationRequired will not be emitted.
request will immediately finish with the same "Connection closed".

So I am looking for the way to  enforce authentication.

I tried to set  setCache ( NULL );
but it was already null when signal finished was emitted,
so I am not sure how QNetworkAccessManager determines that
authentication is (not) needed.

My Qt version is 4.7.3.
Any help is appreciated.


More information about the Interest mailing list