KIOSlave
httpauthentication.cpp
Go to the documentation of this file.
79 static QList<QByteArray> parseChallenge(QByteArray &ba, QByteArray *scheme, QByteArray* nextAuth = 0)
193 kDebug(7113) << "unexpected character" << b[end] << "found in WWW-authentication header where token boundary (,) was expected";
266 KAbstractHttpAuthentication *KAbstractHttpAuthentication::newAuth(const QByteArray &offer, KConfigGroup* config)
357 void KAbstractHttpAuthentication::generateResponseCommon(const QString &user, const QString &password)
481 authStr += resource.encodedPathAndQuery(KUrl::LeaveTrailingSlash, KUrl::AvoidEmptyPath).toLatin1();
600 if (info.digestURIs.isEmpty() /*###&& (m_request.responseCode == 401 || m_request.responseCode == 407)*/)
609 QString requestPath = m_resource.directory(KUrl::AppendTrailingSlash | KUrl::ObeyTrailingSlash);
658 auth += m_resource.encodedPathAndQuery(KUrl::LeaveTrailingSlash, KUrl::AvoidEmptyPath).toLatin1();
725 // Every auth scheme is supposed to supply a realm according to the RFCs. Of course this doesn't
727 // we don't have the username yet which may (may!) contain a domain, so we really have no choice
768 if (!KNTLM::getAuth(buf, challenge, user, m_password, domain, QLatin1String("WORKSTATION"), flags)) {
797 ret = gss_display_status(&new_status, major_status, GSS_C_GSS_CODE, GSS_C_NULL_OID, &msg_ctx, &major_string);
800 ret = gss_display_status(&new_status, minor_status, GSS_C_MECH_CODE, GSS_C_NULL_OID, &msg_ctx, &minor_string);
832 void KHttpNegotiateAuthentication::generateResponse(const QString &user, const QString &password)
static KAbstractHttpAuthentication * newAuth(const QByteArray &offer, KConfigGroup *config=0)
Returns authentication object instance appropriate for offer.
Definition: httpauthentication.cpp:266
void clear()
virtual ~KAbstractHttpAuthentication()
Definition: httpauthentication.cpp:223
virtual void generateResponse(const QString &user, const QString &password)
what to do in response to challenge
Definition: httpauthentication.cpp:519
void clear()
QString directory(const DirectoryOptions &options=IgnoreTrailingSlash) const
void clear()
KUrl url
virtual QByteArray scheme() const
the authentication scheme: "Negotiate", "Digest", "Basic", "NTLM"
Definition: httpauthentication.cpp:400
virtual QByteArray scheme() const
the authentication scheme: "Negotiate", "Digest", "Basic", "NTLM"
Definition: httpauthentication.cpp:697
KAbstractHttpAuthentication(KConfigGroup *config=0)
Definition: httpauthentication.cpp:217
QByteArray toLower() const
QByteArray trimmed() const
bool keepPassword
QString digestInfo
virtual void fillKioAuthInfo(KIO::AuthInfo *ai) const
KIO compatible data to find cached credentials.
Definition: httpauthentication.cpp:427
void chop(int n)
QString host() const
QByteArray m_httpMethod
Definition: httpauthentication.h:167
bool isEmpty() const
void generateResponseCommon(const QString &user, const QString &password)
Definition: httpauthentication.cpp:357
static bool getAuth(QByteArray &auth, const QByteArray &challenge, const QString &user, const QString &password, const QString &domain=QString(), const QString &workstation=QString(), AuthFlags authflags=Add_LM)
QByteArray fromRawData(const char *data, int size)
static bool containsScheme(const char input[], int start, int end)
Definition: httpauthentication.cpp:59
int length() const
int port() const
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
virtual QByteArray scheme() const =0
the authentication scheme: "Negotiate", "Digest", "Basic", "NTLM"
Definition: httpauthentication.h:182
static QList< QByteArray > splitOffers(const QList< QByteArray > &offers)
Split all headers containing multiple authentication offers.
Definition: httpauthentication.cpp:284
static bool getNegotiate(QByteArray &negotiate, const QString &domain=QString(), const QString &workstation=QString(), quint32 flags=Negotiate_Unicode|Request_Target|Negotiate_NTLM)
void clear()
int indexOf(char ch, int from) const
virtual void generateResponse(const QString &user, const QString &password)
what to do in response to challenge
Definition: httpauthentication.cpp:732
int count(const T &value) const
static QByteArray valueForKey(const QList< QByteArray > &ba, const QByteArray &key)
Definition: httpauthentication.cpp:207
void append(const T &value)
QString realmValue
bool m_forceDisconnect
Definition: httpauthentication.h:172
bool verifyPath
static QByteArray calculateResponse(const DigestAuthInfo &info, const KUrl &resource)
Definition: httpauthentication.cpp:450
virtual QByteArray scheme() const
the authentication scheme: "Negotiate", "Digest", "Basic", "NTLM"
Definition: httpauthentication.cpp:376
QString protocol() const
bool isEmpty() const
bool m_forceKeepAlive
Definition: httpauthentication.h:171
bool isEmpty() const
const char * constData() const
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
virtual void setChallenge(const QByteArray &c, const KUrl &resource, const QByteArray &httpMethod)
initiate authentication with challenge string (from HTTP header)
Definition: httpauthentication.cpp:703
virtual void setChallenge(const QByteArray &c, const KUrl &resource, const QByteArray &httpMethod)
initiate authentication with challenge string (from HTTP header)
Definition: httpauthentication.cpp:406
static QByteArray bestOffer(const QList< QByteArray > &offers)
Choose the best authentication mechanism from the offered ones.
Definition: httpauthentication.cpp:227
void update(const char *in, int len=-1)
int count(char ch) const
void authInfoBoilerplate(KIO::AuthInfo *a) const
Definition: httpauthentication.cpp:345
virtual void generateResponse(const QString &user, const QString &password)
what to do in response to challenge
Definition: httpauthentication.cpp:387
QByteArray mid(int pos, int len) const
QByteArray hexDigest()
QByteArray m_headerFragment
Definition: httpauthentication.h:175
QString toLower() const
bool m_finalAuthStage
Definition: httpauthentication.h:173
bool contains(QChar ch, Qt::CaseSensitivity cs) const
virtual void setChallenge(const QByteArray &c, const KUrl &resource, const QByteArray &httpMethod)
initiate authentication with challenge string (from HTTP header)
Definition: httpauthentication.cpp:322
virtual void fillKioAuthInfo(KIO::AuthInfo *ai) const
KIO compatible data to find cached credentials.
Definition: httpauthentication.cpp:722
QByteArray m_scheme
this is parsed from the header and not necessarily == scheme().
Definition: httpauthentication.h:163
KLocale * locale()
virtual QByteArray authDataToCache() const
Returns any authentication data that should be cached for future use.
Definition: httpauthentication.h:159
QByteArray left(int len) const
bool isValid() const
bool m_needCredentials
Definition: httpauthentication.h:170
QByteArray toLatin1() const
QString encodedPathAndQuery(AdjustPathOption trailing=LeaveTrailingSlash, const EncodedPathAndQueryOptions &options=PermitEmptyPath) const
QString password
QByteArray fromBase64(const QByteArray &base64)
virtual void fillKioAuthInfo(KIO::AuthInfo *ai) const
KIO compatible data to find cached credentials.
Definition: httpauthentication.cpp:382
QTextCodec * codecForName(const QByteArray &name)
T & last()
virtual bool supportsPathMatching() const
Returns true if the authentication scheme supports path matching to identify resources that belong to...
Definition: httpauthentication.h:111
QString username
void removeLast()
QList< QByteArray > m_challenge
Definition: httpauthentication.h:165
char * data()
void reset()
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
QString section(QChar sep, int start, int end, QFlags< QString::SectionFlag > flags) const
QString fromLatin1(const char *str, int size)
KGuiItem cont()
QByteArray toBase64() const
static QList< QByteArray > parseChallenge(QByteArray &ba, QByteArray *scheme, QByteArray *nextAuth=0)
Definition: httpauthentication.cpp:79
QByteArray & remove(int pos, int len)
const KShortcut & end()
QString randomString(int length)
T readEntry(const QString &key, const T &aDefault) const
Definition: httpauthentication.h:222
QString toUnicode(const QByteArray &a) const
QByteArray m_challengeText
Definition: httpauthentication.h:164
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:25:55 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:25:55 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.