QGIS API Documentation
3.24.2-Tisler (13c1a02865)
|
Network authentication handler, used for responding to network authentication requests during network requests. More...
#include <qgsnetworkaccessmanager.h>
Public Member Functions | |
virtual | ~QgsNetworkAuthenticationHandler ()=default |
virtual void | handleAuthRequest (QNetworkReply *reply, QAuthenticator *auth) |
Called whenever network authentication requests are encountered during a network reply. More... | |
virtual void | handleAuthRequestCloseBrowser () |
Called to terminate a network authentication through external browser. More... | |
virtual void | handleAuthRequestOpenBrowser (const QUrl &url) |
Called to initiate a network authentication through external browser url. More... | |
Network authentication handler, used for responding to network authentication requests during network requests.
QgsNetworkAuthenticationHandler responds to authentication requests encountered during network requests. The base QgsNetworkAuthenticationHandler class responds to requests only by logging the request, but does not provide any username or password to allow the request to proceed.
Subclasses can override this behavior by implementing their own handleAuthRequest() method. QgsNetworkAuthenticationHandler are ONLY ever called from the main thread, so it is safe to utilize gui widgets and dialogs during handleAuthRequest (e.g. to present prompts to users requesting the username and password).
If a reply is coming from background thread, that thread is blocked while handleAuthRequest() is running.
An application instance can only have a single network authentication handler. The current authentication handler is set by calling QgsNetworkAccessManager::setAuthHandler(). By default an instance of the logging-only QgsNetworkAuthenticationHandler base class is used.
Definition at line 217 of file qgsnetworkaccessmanager.h.
|
virtualdefault |
|
virtual |
Called whenever network authentication requests are encountered during a network reply.
Subclasses should reimplement this method to implement their own logic regarding how to handle the requests and whether they should be presented to users.
The base class method just logs the request but does not provide any username/password resolution.
Definition at line 864 of file qgsnetworkaccessmanager.cpp.
|
virtual |
Called to terminate a network authentication through external browser.
Definition at line 876 of file qgsnetworkaccessmanager.cpp.
|
virtual |
Called to initiate a network authentication through external browser url.
Definition at line 870 of file qgsnetworkaccessmanager.cpp.