41 if (*method <
Basic && str.startsWith(QLatin1String(
"Basic"), Qt::CaseInsensitive)) {
43 *headerVal = str.mid(6);
44 }
else if (*method <
Ntlm && str.startsWith(QLatin1String(
"NTLM"), Qt::CaseInsensitive)) {
46 *headerVal = str.mid(5);
47 }
else if (*method <
DigestMd5 && str.startsWith(QLatin1String(
"Digest"), Qt::CaseInsensitive)) {
49 *headerVal = str.mid(7);
53 bool KDSoapServerAuthInterface::handleHttpAuth(
const QByteArray &authValue,
const QString &path)
57 if (authValue.isEmpty()) {
64 parseAuthLine(QString::fromLatin1(authValue.constData(), authValue.size()), &method, &headerVal);
72 const QByteArray userPass = QByteArray::fromBase64(headerVal.toLatin1());
73 const int separatorPos = userPass.indexOf(
':');
74 if (separatorPos == -1) {
77 authSettings.
setUser(QString::fromUtf8(userPass.left(separatorPos).constData()));
78 authSettings.
setPassword(QString::fromUtf8(userPass.mid(separatorPos + 1).constData()));
83 qWarning(
"Unsupported authentication mechanism %s", authValue.constData());
static void parseAuthLine(const QString &str, Method *method, QString *headerVal)
void setPassword(const QString &password)
void setUser(const QString &user)
KDSoapServerAuthInterface()
virtual bool validateAuthentication(const KDSoapAuthentication &auth, const QString &path)
virtual ~KDSoapServerAuthInterface()