Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
authenticationRequired signal not emited or slot not called
gollum last edited by
I am having a strange behavior with QNetworkAccessManager. I am getting a QNetworkReply::NetworkError(AuthenticationRequiredError) but the authenticationRequired signal seems not getting emited. The Server is throwing a 401. Any ideas what is wrong?
I am calling it like:
manager->get(request); connect(manager, SIGNAL(finished(QNetworkReply*)),this, SLOT(replyFinished(QNetworkReply*))); connect(manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),this, SLOT(auth(QNetworkReply*,QAuthenticator*)));
IIRC the authenticationRequired signal will be emitted when the HTTP response contains a WWW-Authenticate header.
HTTP401 is just an error code that you are not allowed to view this resource. So the webserver/webapplication doesn't even ask you to authenticate.