public ICredentials GetCredentials(Uri uri, IWebProxy proxy, CredentialType credentialType, bool retrying)
{
// Note: this might cause deadlock, but NuGet is sync while we need async, so keep it this way
var credentialsTask = _authenticationProvider.GetCredentialsAsync(uri, retrying);
var credentials = credentialsTask.Result;
if (credentials == null || (string.IsNullOrWhiteSpace(credentials.UserName) && string.IsNullOrWhiteSpace(credentials.Password)))
{
return null;
}
return new NetworkCredential(credentials.UserName, credentials.Password);
}
#endregion