views:

901

answers:

2

I'm working with a webservice which requires a valid username/password. From PyQt, I'm accessing the webservice using QNetworkAccessManager which emits the

authenticationRequired (QNetworkReply*, QAuthenticator*)

signal when (obviously),authentication is required. When I fill in the user and psswd for QAuthenticator, everything works fine. However, I can't see how to break the look when the user is not valid.

From the docs for authenticationRequired:

"If it rejects the credentials, this signal will be emitted again."

For invalid credentials this signal is emitted again, and again, and again....looking at the error code in the reply showed 0. How is this loop supposed to be broken or handled so that it terminates with an error?

+2  A: 

Yeh, it's odd. What I've done previously is check if I've already authenticated with those details and if I have then call QNetworkReply.abort()

Mike McQuaid
+1  A: 

What about trying:

QNetworkReply::abort()

or

QNetworkReply::close()

?

Karl Voigtland