Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request to add HTTP authentication support to WebClient #77

Open
varakreivi opened this issue Nov 23, 2017 · 1 comment
Open

Request to add HTTP authentication support to WebClient #77

varakreivi opened this issue Nov 23, 2017 · 1 comment
Assignees

Comments

@varakreivi
Copy link

varakreivi commented Nov 23, 2017

Currently, the HttpWebRequest task(s) support giving UserName and UserPassword as parameters to enable basic HTTP authentication (added in revision 890 by wayne.bradney). I would like to be able to use the same logic for WebClient.DownloadFile, as our build automation flow relies on querying for build artifacts through TeamCity server's REST API and downloading the latest ones.

I moved the following lines of code locally into WebClient.cs to DownloadFile and OpenRead functions, and checked that the solution works for me simply by replacing the resulting DLL, but it would be great to have official support for this as well:

if (!string.IsNullOrEmpty(this.UserName))
{
client.Credentials = new System.Net.NetworkCredential(this.UserName, this.UserPassword);
}

I'm attaching the file I made changes to.

WebClient.zip

@varakreivi
Copy link
Author

Any update or schedule on this issue? Just updating to say that it is still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants