本文整理汇总了C++中AuthenticationChallenge::authenticationClient方法的典型用法代码示例。如果您正苦于以下问题:C++ AuthenticationChallenge::authenticationClient方法的具体用法?C++ AuthenticationChallenge::authenticationClient怎么用?C++ AuthenticationChallenge::authenticationClient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AuthenticationChallenge
的用法示例。
在下文中一共展示了AuthenticationChallenge::authenticationClient方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: platformCompare
bool AuthenticationChallenge::platformCompare(const AuthenticationChallenge& a, const AuthenticationChallenge& b)
{
if (a.authenticationClient() != b.authenticationClient())
return false;
if (a.cfURLAuthChallengeRef() != b.cfURLAuthChallengeRef())
return false;
return true;
}
示例2: dispatchDidReceiveAuthenticationChallenge
void WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoader* loader, unsigned long identifier, const AuthenticationChallenge& challenge)
{
ASSERT(challenge.authenticationClient());
WebView* webView = m_webFrame->webView();
COMPtr<IWebResourceLoadDelegate> resourceLoadDelegate;
if (SUCCEEDED(webView->resourceLoadDelegate(&resourceLoadDelegate))) {
COMPtr<WebURLAuthenticationChallenge> webChallenge(AdoptCOM, WebURLAuthenticationChallenge::createInstance(challenge));
if (SUCCEEDED(resourceLoadDelegate->didReceiveAuthenticationChallenge(webView, identifier, webChallenge.get(), getWebDataSource(loader))))
return;
}
// If the ResourceLoadDelegate doesn't exist or fails to handle the call, we tell the ResourceHandle
// to continue without credential - this is the best approximation of Mac behavior
challenge.authenticationClient()->receivedRequestToContinueWithoutCredential(challenge);
}
示例3: didReceiveAuthenticationChallenge
void ResourceHandle::didReceiveAuthenticationChallenge(const AuthenticationChallenge& challenge)
{
LOG(Network, "CFNet - didReceiveAuthenticationChallenge()");
ASSERT(d->m_currentWebChallenge.isNull());
// Since CFURLConnection networking relies on keeping a reference to the original CFURLAuthChallengeRef,
// we make sure that is actually present
ASSERT(challenge.cfURLAuthChallengeRef());
ASSERT(challenge.authenticationClient() == this); // Should be already set.
#if !PLATFORM(WIN)
// Proxy authentication is handled by CFNetwork internally. We can get here if the user cancels
// CFNetwork authentication dialog, and we shouldn't ask the client to display another one in that case.
if (challenge.protectionSpace().isProxy()) {
// Cannot use receivedRequestToContinueWithoutCredential(), because current challenge is not yet set.
CFURLConnectionUseCredential(d->m_connection.get(), 0, challenge.cfURLAuthChallengeRef());
return;
}
#endif
if (tryHandlePasswordBasedAuthentication(challenge))
return;
d->m_currentWebChallenge = challenge;
if (client())
client()->didReceiveAuthenticationChallenge(this, d->m_currentWebChallenge);
else {
clearAuthentication();
CFURLConnectionPerformDefaultHandlingForChallenge(d->m_connection.get(), challenge.cfURLAuthChallengeRef());
}
}
示例4: didReceiveAuthenticationChallenge
void ResourceHandle::didReceiveAuthenticationChallenge(const AuthenticationChallenge& challenge)
{
LOG(Network, "CFNet - didReceiveAuthenticationChallenge()");
ASSERT(d->m_currentWebChallenge.isNull());
// Since CFURLConnection networking relies on keeping a reference to the original CFURLAuthChallengeRef,
// we make sure that is actually present
ASSERT(challenge.cfURLAuthChallengeRef());
ASSERT(challenge.authenticationClient() == this); // Should be already set.
if (!d->m_user.isNull() && !d->m_pass.isNull()) {
RetainPtr<CFStringRef> user(AdoptCF, d->m_user.createCFString());
RetainPtr<CFStringRef> pass(AdoptCF, d->m_pass.createCFString());
RetainPtr<CFURLCredentialRef> credential(AdoptCF,
CFURLCredentialCreate(kCFAllocatorDefault, user.get(), pass.get(), 0, kCFURLCredentialPersistenceNone));
KURL urlToStore;
if (challenge.failureResponse().httpStatusCode() == 401)
urlToStore = firstRequest().url();
CredentialStorage::set(core(credential.get()), challenge.protectionSpace(), urlToStore);
CFURLConnectionUseCredential(d->m_connection.get(), credential.get(), challenge.cfURLAuthChallengeRef());
d->m_user = String();
d->m_pass = String();
// FIXME: Per the specification, the user shouldn't be asked for credentials if there were incorrect ones provided explicitly.
return;
}
if (!client() || client()->shouldUseCredentialStorage(this)) {
if (!d->m_initialCredential.isEmpty() || challenge.previousFailureCount()) {
// The stored credential wasn't accepted, stop using it.
// There is a race condition here, since a different credential might have already been stored by another ResourceHandle,
// but the observable effect should be very minor, if any.
CredentialStorage::remove(challenge.protectionSpace());
}
if (!challenge.previousFailureCount()) {
Credential credential = CredentialStorage::get(challenge.protectionSpace());
if (!credential.isEmpty() && credential != d->m_initialCredential) {
ASSERT(credential.persistence() == CredentialPersistenceNone);
if (challenge.failureResponse().httpStatusCode() == 401) {
// Store the credential back, possibly adding it as a default for this directory.
CredentialStorage::set(credential, challenge.protectionSpace(), firstRequest().url());
}
RetainPtr<CFURLCredentialRef> cfCredential(AdoptCF, createCF(credential));
CFURLConnectionUseCredential(d->m_connection.get(), cfCredential.get(), challenge.cfURLAuthChallengeRef());
return;
}
}
}
d->m_currentWebChallenge = challenge;
if (client())
client()->didReceiveAuthenticationChallenge(this, d->m_currentWebChallenge);
}
示例5: dispatchDidReceiveAuthenticationChallenge
void WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoader* loader, unsigned long identifier, const AuthenticationChallenge& challenge)
{
#if USE(CURL)
ASSERT(challenge.authenticationClient());
#endif
WebView* webView = m_webFrame->webView();
SharedPtr<WebResourceLoadDelegate> resourceLoadDelegate = webView->webResourceLoadDelegate();
if (resourceLoadDelegate) {
WebURLAuthenticationChallenge* webChallenge = WebURLAuthenticationChallenge::createInstance(challenge);
resourceLoadDelegate->didReceiveAuthenticationChallenge(webView, identifier, webChallenge, getWebDataSource(loader));
delete webChallenge;
}
#if USE(CURL)
// If the ResourceLoadDelegate doesn't exist or fails to handle the call, we tell the ResourceHandle
// to continue without credential - this is the best approximation of Mac behavior
challenge.authenticationClient()->receivedRequestToContinueWithoutCredential(challenge);
#endif
}
示例6: cancelChallenge
void AuthenticationManager::cancelChallenge(uint64_t challengeID)
{
AuthenticationChallenge challenge = m_challenges.take(challengeID);
ASSERT(!challenge.isNull());
AuthenticationClient* coreClient = challenge.authenticationClient();
if (!coreClient) {
// This authentication challenge comes from a download.
Download::receivedCancellation(challenge);
return;
}
coreClient->receivedCancellation(challenge);
}
示例7: continueWithoutCredentialForChallenge
void AuthenticationManager::continueWithoutCredentialForChallenge(uint64_t challengeID)
{
AuthenticationChallenge challenge = m_challenges.take(challengeID);
ASSERT(!challenge.isNull());
AuthenticationClient* coreClient = challenge.authenticationClient();
if (!coreClient) {
// This authentication challenge comes from a download.
Download::receivedRequestToContinueWithoutCredential(challenge);
return;
}
coreClient->receivedRequestToContinueWithoutCredential(challenge);
}
示例8: didReceiveAuthenticationChallenge
void NetworkResourceLoader::didReceiveAuthenticationChallenge(ResourceHandle* handle, const AuthenticationChallenge& challenge)
{
ASSERT_UNUSED(handle, handle == m_handle);
// NetworkResourceLoader does not know whether the request is cross origin, so Web process computes an applicable credential policy for it.
ASSERT(m_parameters.clientCredentialPolicy != DoNotAskClientForCrossOriginCredentials);
if (m_parameters.clientCredentialPolicy == DoNotAskClientForAnyCredentials) {
challenge.authenticationClient()->receivedRequestToContinueWithoutCredential(challenge);
return;
}
NetworkProcess::shared().authenticationManager().didReceiveAuthenticationChallenge(m_parameters.webPageID, m_parameters.webFrameID, challenge);
}
示例9: performDefaultHandlingForSingleChallenge
void AuthenticationManager::performDefaultHandlingForSingleChallenge(uint64_t challengeID)
{
AuthenticationChallenge challenge = m_challenges.take(challengeID);
ASSERT(!challenge.isNull());
AuthenticationClient* coreClient = challenge.authenticationClient();
if (!coreClient) {
// FIXME: The authentication client is null for downloads, but it can also be null for canceled loads.
// We should not call Download::receivedCredential in the latter case.
Download::receivedRequestToPerformDefaultHandling(challenge);
return;
}
coreClient->receivedRequestToPerformDefaultHandling(challenge);
}
示例10: didReceiveAuthenticationChallenge
void NetworkResourceLoader::didReceiveAuthenticationChallenge(ResourceHandle* handle, const AuthenticationChallenge& challenge)
{
ASSERT_UNUSED(handle, handle == m_handle);
// FIXME (http://webkit.org/b/115291): Since we go straight to the UI process for authentication we don't get WebCore's
// cross-origin check before asking the client for credentials.
// Therefore we are too permissive in the case where the ClientCredentialPolicy is DoNotAskClientForCrossOriginCredentials.
if (m_clientCredentialPolicy == DoNotAskClientForAnyCredentials) {
challenge.authenticationClient()->receivedRequestToContinueWithoutCredential(challenge);
return;
}
NetworkProcess::shared().authenticationManager().didReceiveAuthenticationChallenge(m_webPageID, m_webFrameID, challenge);
}
示例11: rejectProtectionSpaceAndContinueForSingleChallenge
void AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge(uint64_t challengeID)
{
AuthenticationChallenge challenge = m_challenges.take(challengeID);
ASSERT(!challenge.isNull());
AuthenticationClient* coreClient = challenge.authenticationClient();
if (!coreClient) {
// FIXME: The authentication client is null for downloads, but it can also be null for canceled loads.
// We should not call Download::receivedCredential in the latter case.
Download::receivedChallengeRejection(challenge);
return;
}
coreClient->receivedChallengeRejection(challenge);
}
示例12: cancelChallenge
void AuthenticationManager::cancelChallenge(uint64_t challengeID)
{
ASSERT(RunLoop::isMain());
AuthenticationChallenge challenge = m_challenges.take(challengeID);
ASSERT(!challenge.isNull());
AuthenticationClient* coreClient = challenge.authenticationClient();
if (!coreClient) {
// FIXME: The authentication client is null for downloads, but it can also be null for canceled loads.
// We should not call Download::receivedCredential in the latter case.
Download::receivedCancellation(challenge);
return;
}
coreClient->receivedCancellation(challenge);
}
示例13: useCredentialForChallenge
void AuthenticationManager::useCredentialForChallenge(uint64_t challengeID, const Credential& credential, const PlatformCertificateInfo& certificateInfo)
{
AuthenticationChallenge challenge = m_challenges.take(challengeID);
ASSERT(!challenge.isNull());
if (tryUsePlatformCertificateInfoForChallenge(challenge, certificateInfo))
return;
AuthenticationClient* coreClient = challenge.authenticationClient();
if (!coreClient) {
// This authentication challenge comes from a download.
Download::receivedCredential(challenge, credential);
return;
}
coreClient->receivedCredential(challenge, credential);
}
示例14: useCredentialForSingleChallenge
void AuthenticationManager::useCredentialForSingleChallenge(uint64_t challengeID, const Credential& credential, const CertificateInfo& certificateInfo)
{
AuthenticationChallenge challenge = m_challenges.take(challengeID);
ASSERT(!challenge.isNull());
if (tryUseCertificateInfoForChallenge(challenge, certificateInfo))
return;
AuthenticationClient* coreClient = challenge.authenticationClient();
if (!coreClient) {
// FIXME: The authentication client is null for downloads, but it can also be null for canceled loads.
// We should not call Download::receivedCredential in the latter case.
Download::receivedCredential(challenge, credential);
return;
}
coreClient->receivedCredential(challenge, credential);
}
示例15: didReceiveAuthenticationChallenge
void ResourceHandle::didReceiveAuthenticationChallenge(const AuthenticationChallenge& challenge)
{
ASSERT(d->m_currentWebChallenge.isNull());
ASSERT(challenge.authenticationClient() == this);
if (!d->m_user.isNull() && !d->m_pass.isNull()) {
Credential urlCredential(d->m_user, d->m_pass, CredentialPersistenceNone);
KURL urlToStore;
urlToStore = d->m_request.url();
CredentialStorage::set(urlCredential, challenge.protectionSpace(), urlToStore);
d->m_user = String();
d->m_pass = String();
return;
}
d->m_currentWebChallenge = challenge;
if (client())
client()->didReceiveAuthenticationChallenge(this, d->m_currentWebChallenge);
}