Part of Microsoft's .NET Framework that provides a base class for supplying credentials for password based authentication schemes such as basic, digest, NTLM or Kerberos.
Questions tagged [networkcredentials]
148 questions
26
votes
5 answers
change sender address when sending mail through gmail in c#
I have used the following code to send mail from my web application using a gmail account. My question is, can i change the sender address to another address other than original sender(gmail) address?
My code is as…

ACP
- 34,682
- 100
- 231
- 371
14
votes
3 answers
Can't get the network credentials to work
So I've been working with DotNetOpenAuth for a while, Today I needed to add support for provider that forces me to send the secret key with Basic authentication (I've been using an old version and only Post parameters)
I've tried using…

Madd0g
- 3,841
- 5
- 37
- 59
14
votes
3 answers
WebProxy error: Proxy Authentication Required
I use the following code to obtaing html data from the internet:
WebProxy p = new WebProxy("localproxyIP:8080", true);
p.Credentials = new NetworkCredential("domain\\user", "password");
WebRequest.DefaultWebProxy = p;
WebClient client = new…

Oleg Ignatov
- 877
- 2
- 8
- 22
10
votes
1 answer
HtmlAgilityPack and Authentication
I have a method to get ids and xpaths if given a particular url. How do I pass in the username and password with the request so that I can scrape a url that requires a username and password?
using HtmlAgilityPack;
_web = new HtmlWeb();
internal…

Jonathan Kittell
- 7,163
- 15
- 50
- 93
8
votes
2 answers
How to 'share' NTLM authentication across multiple HttpWebRequests?
My C# app hits a web server that uses NTLM authentication.
I find that each request made to the server (using a new HttpWebRequest) is individually authenticated. In other words, every request results in a 401 response, after which an NTLM…

mackenir
- 10,801
- 16
- 68
- 100
7
votes
1 answer
How to validate domain credentials (from native code)?
i want to validate a set of credentials against the domain controller. e.g.:
Username: joel
Password: splotchy
Domain: STACKOVERFLOW
In .NET 3.5 and newer you can use PrincipalContext.ValidateCredentials(username, password).
Otherwise you're in…

Ian Boyd
- 246,734
- 253
- 869
- 1,219
6
votes
3 answers
NetworkCredential error in ASP.NET
I am trying to access a webpage through ASP.NET using the NetworkCredential class. However I keep getting an exception with the following message System.Security.Cryptography.CryptographicException: The handle is invalid
Below is my code on how I…

Seb
- 3,414
- 10
- 73
- 106
6
votes
1 answer
Programmatically connecting to TFS getting "TF30063: You are not authorized" error
I am trying to create a program in c# that allows me to connect to my TFS in order to create new work items.
NetworkCredential netCred = new NetworkCredential(
"username",
"password");
BasicAuthCredential basicCred = new…

NigelMassey
- 305
- 1
- 2
- 10
6
votes
1 answer
HttpWebRequest DefaultNetworkCredentials give error 401
Im trying to request a url that require windows authentication using HttpWebRequest, I was using
request.Credential = New NetworkCredential("username", "password");
everything was working find until I decide not to hardcord the username and…

Jerry Lam
- 452
- 1
- 7
- 21
5
votes
2 answers
Convert NetworkCredentials to a PSCredential?
Is it possible to convert NetworkCredentials (or a variant) to a PSCredential?
I want to transparently use the credentials of the current user, but don't want to prompt them.

makerofthings7
- 60,103
- 53
- 215
- 448
4
votes
1 answer
How does NetworkCredential in C# works when assigned to a HttpRequest object?
I want to know how NetworkCredentials are passed over an http request. Do they get passed as HTTPHeaders, RequestData or there is something else that carries the information.
I tried creating a sample app and checked the fiddler logs. I don't see it…

Vikas Singh
- 41
- 2
4
votes
1 answer
SmtpClient is working with wrong credentials
My Smtpclient is working with following setup
SmtpClient client = new SmtpClient();
client.Host = server;
client.UseDefaultCredentials = false;
client.Credentials = new NetworkCredential("username", "totallywrongpassword", "DOMAIN");
try
{
…

Mathias Colpaert
- 652
- 6
- 23
4
votes
1 answer
get disk_space with credentials
Well, what I am trying to do is, to get space information of disks in a LAN. I stored the UNC Paths in a XML-File and loop through it.
In PHP I do:
$filename = 'C:/...../config/config.xml';
echo '
';
if…

Murat Yazi
- 85
- 1
- 8
4
votes
1 answer
Disable credential manager for single application
I have a C# application that uses the rasapi32.dll to create a dial up connection. When I create such a connection under Windows 7, the credentials get stored in the credential manager as an entry called *session.
This *session entry in the…

raeffs
- 595
- 5
- 17
4
votes
2 answers
providing domain/user credentials to webview control
Does anyone know how to provide credentials to a WebView control (or even better - run a Windows 8 Metro style application / WinRT app in the context of a specific domain user?) I've tried following the HttpClient + WebView approach as listed here…

Henry C
- 4,781
- 4
- 43
- 83