void AuthenticationManager::useCredentialForSingleChallenge(uint64_t challengeID, const Credential& credential, const CertificateInfo& certificateInfo)
{
    auto challenge = m_challenges.take(challengeID);
    ASSERT(!challenge.challenge.isNull());

    if (tryUseCertificateInfoForChallenge(challenge.challenge, certificateInfo))
        return;

    AuthenticationClient* coreClient = challenge.challenge.authenticationClient();
#if USE(NETWORK_SESSION)
    // If there is a completion handler, then there is no AuthenticationClient.
    // FIXME: Remove the use of AuthenticationClient in WebKit2 once NETWORK_SESSION is used for all loads.
    if (challenge.completionHandler) {
        ASSERT(!coreClient);
        challenge.completionHandler(AuthenticationChallengeDisposition::UseCredential, credential);
        return;
    }
#else
    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.challenge, credential);
        return;
    }
#endif

    ASSERT(coreClient);
    coreClient->receivedCredential(challenge.challenge, credential);
}
void AuthenticationManager::useCredentialForSingleChallenge(uint64_t challengeID, const Credential& credential, const CertificateInfo& certificateInfo)
{
    auto challenge = m_challenges.take(challengeID);
    ASSERT(!challenge.challenge.isNull());

#if USE(NETWORK_SESSION)
    auto completionHandler = challenge.completionHandler;
#else
    ChallengeCompletionHandler completionHandler = nullptr;
#endif
    
    if (tryUseCertificateInfoForChallenge(challenge.challenge, certificateInfo, completionHandler))
        return;

    AuthenticationClient* coreClient = challenge.challenge.authenticationClient();
#if USE(NETWORK_SESSION)
    // If there is a completion handler, then there is no AuthenticationClient.
    // FIXME: Remove the use of AuthenticationClient in WebKit2 once NETWORK_SESSION is used for all loads.
    if (completionHandler) {
        ASSERT(!coreClient);
        challenge.completionHandler(AuthenticationChallengeDisposition::UseCredential, credential);
        return;
    }
#endif

    if (coreClient)
        coreClient->receivedCredential(challenge.challenge, credential);
    else
        receivedCredential(challenge.challenge, credential);
}
Exemple #3
0
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);
}
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);
}