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>.
|
#include <qauthenticator_p.h>
Public Types | |
enum | Method { None , Basic , Negotiate , Ntlm , DigestMd5 } |
enum | Phase { Start , Phase1 , Phase2 , Done , Invalid } |
Public Member Functions | |
QAuthenticatorPrivate () | |
~QAuthenticatorPrivate () | |
QByteArray | calculateResponse (QByteArrayView method, QByteArrayView path, QStringView host) |
QByteArray | digestMd5Response (QByteArrayView challenge, QByteArrayView method, QByteArrayView path) |
void | parseHttpResponse (const QHttpHeaders &headers, bool isProxy, QStringView host) |
void | updateCredentials () |
Static Public Member Functions | |
static QAuthenticatorPrivate * | getPrivate (QAuthenticator &auth) |
static const QAuthenticatorPrivate * | getPrivate (const QAuthenticator &auth) |
static QHash< QByteArray, QByteArray > | parseDigestAuthenticationChallenge (QByteArrayView challenge) |
static bool | isMethodSupported (QByteArrayView method) |
Public Attributes | |
QString | user |
QString | extractedUser |
QString | password |
QVariantHash | options |
Method | method |
QString | realm |
QByteArray | challenge |
bool | hasFailed |
Phase | phase |
QByteArray | cnonce |
int | nonceCount |
QString | workstation |
QString | userDomain |
Definition at line 36 of file qauthenticator_p.h.
Enumerator | |
---|---|
None | |
Basic | |
Negotiate | |
Ntlm | |
DigestMd5 |
Definition at line 39 of file qauthenticator_p.h.
Enumerator | |
---|---|
Start | |
Phase1 | |
Phase2 | |
Done | |
Invalid |
Definition at line 57 of file qauthenticator_p.h.
QAuthenticatorPrivate::QAuthenticatorPrivate | ( | ) |
Definition at line 377 of file qauthenticator.cpp.
References cnonce, QCryptographicHash::hash(), QCryptographicHash::Md5, nonceCount, QByteArray::number(), and QRandomGenerator::system().
|
default |
QByteArray QAuthenticatorPrivate::calculateResponse | ( | QByteArrayView | method, |
QByteArrayView | path, | ||
QStringView | host ) |
Definition at line 542 of file qauthenticator.cpp.
References Basic, challenge, DigestMd5, digestMd5Response(), Done, QByteArray::fromBase64(), QByteArray::isEmpty(), QString::isEmpty(), method, Negotiate, None, Ntlm, password, phase, Phase2, Q_UNUSED, qNtlmPhase1(), qNtlmPhase3(), qWarning, QByteArray::toBase64(), and user.
QByteArray QAuthenticatorPrivate::digestMd5Response | ( | QByteArrayView | challenge, |
QByteArrayView | method, | ||
QByteArrayView | path ) |
Definition at line 799 of file qauthenticator.cpp.
References challenge, cnonce, digestMd5ResponseHelper(), QByteArray::isEmpty(), method, nonceCount, QByteArray::number(), options, parseDigestAuthenticationChallenge(), password, realm, QString::toLatin1(), user, and QHash< Key, T >::value().
Referenced by calculateResponse().
|
inlinestatic |
Definition at line 77 of file qauthenticator_p.h.
|
inlinestatic |
Definition at line 76 of file qauthenticator_p.h.
Referenced by QHttpNetworkConnectionPrivate::copyCredentials(), QHttpNetworkConnectionPrivate::createAuthorization(), QHttpNetworkConnectionChannel::ensureConnection(), QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(), QNetworkAccessManagerPrivate::proxyAuthenticationRequired(), QHttpSocketEngine::slotSocketConnected(), and QHttpSocketEngine::slotSocketReadNotification().
|
static |
Definition at line 413 of file qauthenticator.cpp.
References Qt::CaseInsensitive, method, methods, and Q_ASSERT.
Referenced by QHttpNetworkConnectionPrivate::handleAuthenticateChallenge().
|
static |
Definition at line 661 of file qauthenticator.cpp.
References challenge, containsAuth(), d, QByteArray::data(), options, quote(), QByteArray::size(), and QHash< Key, T >::value().
Referenced by digestMd5Response(), parseHttpResponse(), and verifyDigestMD5().
void QAuthenticatorPrivate::parseHttpResponse | ( | const QHttpHeaders & | headers, |
bool | isProxy, | ||
QStringView | host ) |
Definition at line 448 of file qauthenticator.cpp.
References Basic, Qt::CaseInsensitive, challenge, QString::clear(), QVariant::compare(), DigestMd5, Done, QString::fromLatin1(), Invalid, QString::isEmpty(), method, QByteArrayView::mid(), Negotiate, nonceCount, None, Ntlm, options, parseDigestAuthenticationChallenge(), password, phase, QHttpHeaders::ProxyAuthenticate, Q_UNUSED, QByteArray(), realm, Start, QString::startsWith(), str, QByteArray::trimmed(), updateCredentials(), user, QHash< Key, T >::value(), QHttpHeaders::values(), verifyDigestMD5(), and QHttpHeaders::WWWAuthenticate.
void QAuthenticatorPrivate::updateCredentials | ( | ) |
Definition at line 390 of file qauthenticator.cpp.
References QString::clear(), extractedUser, QString::indexOf(), QString::left(), method, QString::mid(), Ntlm, realm, user, and userDomain.
Referenced by parseHttpResponse(), and QAuthenticator::setUser().
QByteArray QAuthenticatorPrivate::challenge |
Definition at line 49 of file qauthenticator_p.h.
Referenced by calculateResponse(), digestMd5Response(), parseDigestAuthenticationChallenge(), and parseHttpResponse().
QByteArray QAuthenticatorPrivate::cnonce |
Definition at line 67 of file qauthenticator_p.h.
Referenced by QAuthenticatorPrivate(), and digestMd5Response().
QString QAuthenticatorPrivate::extractedUser |
Definition at line 44 of file qauthenticator_p.h.
Referenced by QAuthenticator::operator=(), and updateCredentials().
bool QAuthenticatorPrivate::hasFailed |
Definition at line 55 of file qauthenticator_p.h.
Method QAuthenticatorPrivate::method |
Definition at line 47 of file qauthenticator_p.h.
Referenced by calculateResponse(), digestMd5Response(), isMethodSupported(), QAuthenticator::operator=(), QAuthenticator::operator==(), parseHttpResponse(), and updateCredentials().
int QAuthenticatorPrivate::nonceCount |
Definition at line 68 of file qauthenticator_p.h.
Referenced by QAuthenticatorPrivate(), digestMd5Response(), and parseHttpResponse().
QVariantHash QAuthenticatorPrivate::options |
Definition at line 46 of file qauthenticator_p.h.
Referenced by digestMd5Response(), QAuthenticator::operator=(), QAuthenticator::operator==(), QAuthenticator::option(), QAuthenticator::options(), parseDigestAuthenticationChallenge(), parseHttpResponse(), and QAuthenticator::setOption().
QString QAuthenticatorPrivate::password |
Definition at line 45 of file qauthenticator_p.h.
Referenced by calculateResponse(), digestMd5Response(), QAuthenticator::operator=(), QAuthenticator::operator==(), parseHttpResponse(), QAuthenticator::password(), and QAuthenticator::setPassword().
Phase QAuthenticatorPrivate::phase |
Definition at line 64 of file qauthenticator_p.h.
Referenced by calculateResponse(), QAuthenticator::detach(), QAuthenticator::operator=(), and parseHttpResponse().
QString QAuthenticatorPrivate::realm |
Definition at line 48 of file qauthenticator_p.h.
Referenced by digestMd5Response(), QAuthenticator::operator=(), QAuthenticator::operator==(), parseHttpResponse(), QAuthenticator::realm(), QAuthenticator::setRealm(), and updateCredentials().
QString QAuthenticatorPrivate::user |
Definition at line 43 of file qauthenticator_p.h.
Referenced by calculateResponse(), digestMd5Response(), QAuthenticator::operator=(), QAuthenticator::operator==(), parseHttpResponse(), QAuthenticator::setUser(), updateCredentials(), and QAuthenticator::user().
QString QAuthenticatorPrivate::userDomain |
Definition at line 72 of file qauthenticator_p.h.
Referenced by QAuthenticator::operator=(), and updateCredentials().
QString QAuthenticatorPrivate::workstation |
Definition at line 71 of file qauthenticator_p.h.
Referenced by QAuthenticator::operator=().