QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
|
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. | |
virtual void | handleAuthRequestCloseBrowser () |
Called to terminate a network authentication through external browser. | |
virtual void | handleAuthRequestOpenBrowser (const QUrl &url) |
Called to initiate a network authentication through external browser url. | |
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 206 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 884 of file qgsnetworkaccessmanager.cpp.
|
virtual |
Called to terminate a network authentication through external browser.
Definition at line 896 of file qgsnetworkaccessmanager.cpp.
|
virtual |
Called to initiate a network authentication through external browser url.
Definition at line 890 of file qgsnetworkaccessmanager.cpp.