MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / slotAuthenticationRequired

Method slotAuthenticationRequired

Plugins/WebBrowser/FrmWebView.cpp:361–374  ·  view source on GitHub ↗

Test example: - https://postman-echo.com/basic-auth - https://httpbin.org/basic-auth/user/passwd - httpbin.org 提供基本的 HTTP 认证测试 - 用户名: user, 密码: passwd

Source from the content-addressed store, hash-verified

359// - httpbin.org 提供基本的 HTTP 认证测试
360// - 用户名: user, 密码: passwd
361void CFrmWebView::slotAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *auth)
362{
363 qDebug(log) << Q_FUNC_INFO;
364 CParameterUser user(nullptr);
365 CDlgUserPassword dlg(this);
366 dlg.SetUser(tr("Set user and password") + "\n" + requestUrl.toString(), &user);
367 if (dlg.exec() == QDialog::Accepted) {
368 auth->setUser(user.GetName());
369 auth->setPassword(user.GetPassword());
370 } else {
371 // Set authenticator null if dialog is cancelled
372 *auth = QAuthenticator();
373 }
374}
375
376void CFrmWebView::slotProxyAuthenticationRequired(const QUrl &url, QAuthenticator *auth,
377 const QString &proxyHost)

Callers

nothing calls this directly

Calls 4

setPasswordMethod · 0.80
SetUserMethod · 0.45
GetNameMethod · 0.45
GetPasswordMethod · 0.45

Tested by

no test coverage detected