Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QNetworkAccessAuthenticationManager Class Reference

#include <qnetworkaccessauthenticationmanager_p.h>

+ Collaboration diagram for QNetworkAccessAuthenticationManager:

Public Member Functions

 QNetworkAccessAuthenticationManager ()
 
void cacheCredentials (const QUrl &url, const QAuthenticator *auth)
 
QNetworkAuthenticationCredential fetchCachedCredentials (const QUrl &url, const QAuthenticator *auth=nullptr)
 Fetch the credential data from the credential cache.
 
void cacheProxyCredentials (const QNetworkProxy &proxy, const QAuthenticator *auth)
 
QNetworkAuthenticationCredential fetchCachedProxyCredentials (const QNetworkProxy &proxy, const QAuthenticator *auth=nullptr)
 
void clearCache ()
 

Protected Attributes

QNetworkAccessCache authenticationCache
 
QMutex mutex
 

Detailed Description

Definition at line 49 of file qnetworkaccessauthenticationmanager_p.h.

Constructor & Destructor Documentation

◆ QNetworkAccessAuthenticationManager()

QNetworkAccessAuthenticationManager::QNetworkAccessAuthenticationManager ( )
inline

Definition at line 52 of file qnetworkaccessauthenticationmanager_p.h.

Member Function Documentation

◆ cacheCredentials()

void QNetworkAccessAuthenticationManager::cacheCredentials ( const QUrl & url,
const QAuthenticator * auth )

◆ cacheProxyCredentials()

void QNetworkAccessAuthenticationManager::cacheProxyCredentials ( const QNetworkProxy & proxy,
const QAuthenticator * auth )

◆ clearCache()

void QNetworkAccessAuthenticationManager::clearCache ( )

Definition at line 267 of file qnetworkaccessauthenticationmanager.cpp.

References authenticationCache, and QNetworkAccessCache::clear().

+ Here is the call graph for this function:

◆ fetchCachedCredentials()

QNetworkAuthenticationCredential QNetworkAccessAuthenticationManager::fetchCachedCredentials ( const QUrl & url,
const QAuthenticator * authentication = nullptr )

Fetch the credential data from the credential cache.

If auth is 0 (as it is when called from createRequest()), this will try to look up with an empty realm. That fails in most cases for HTTP (because the realm is seldom empty for HTTP challenges). In any case, QHttpNetworkConnection never sends the credentials on the first attempt: it needs to find out what authentication methods the server supports.

For FTP, realm is always empty.

Definition at line 241 of file qnetworkaccessauthenticationmanager.cpp.

References authenticationCache, authenticationKey(), cacheKey(), QNetworkAuthenticationCache::findClosestMatch(), QNetworkAccessCache::hasEntry(), QString::isEmpty(), mutex, QUrl::password(), QUrl::path(), QNetworkAccessCache::releaseEntry(), QNetworkAccessCache::requestEntryNow(), ret, and url.

+ Here is the call graph for this function:

◆ fetchCachedProxyCredentials()

QNetworkAuthenticationCredential QNetworkAccessAuthenticationManager::fetchCachedProxyCredentials ( const QNetworkProxy & proxy,
const QAuthenticator * auth = nullptr )

Member Data Documentation

◆ authenticationCache

QNetworkAccessCache QNetworkAccessAuthenticationManager::authenticationCache
protected

◆ mutex

QMutex QNetworkAccessAuthenticationManager::mutex
protected

The documentation for this class was generated from the following files: