networkcredentials

Forms Authentication and HttpWebRequest

Hi, I need to be able to login to a site via Forms Authentication using a HttpWebRequest. Currently, when I provide NetworkCreditials to the request, it just redirects me to the Login page, which makes sense...but how do I go about ensuring that the request correctly authenticates without redirecting? Thanks, Kieron ...

WebRequest is getting generated from another IP instead my system IP?

Hi, I have the following code which bypass the proxy server for local machine and then send a WebRequest. System.Net.HttpWebRequest Request; System.Net.WebResponse Response; System.Net.CredentialCache MyCredentialCache; Edit 1 //System.Net.WebProxy proxyObject = new...

How do I tell a WCF client proxy class to use windows authentication and the WindowsPrincipal of the allready logged in domain user as credentials?

I've got a WPF windows client that calls a WCF web service. The user is already logged in on the windows domain before starting the application and the WCF service uses windows authentication. I want the WPF client to use the WindowsPrincipal of the already logged in user when calling the WCF service. I do NOT want to create a new Netwo...

The remote server returned an error: (401) Unauthorized.

I am extracting gmail contacts using opencontactsnet. I get The remote server returned an error: (401) Unauthorized. when executing this line HttpWebResponse exportResponse = ( HttpWebResponse ) contactsRequest.GetResponse(); using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data; using...

Authenticating ASP.NET MVC user from a WPF application

Hello, How can I authenticate a user (with username and password) of an ASP.NET MVC application? I'm trying to do this using WebClient, passing NetworkCredentials, posting the request to the ASP.NET MVC application from my WPF client. How do I handle this request on the server? How do I get the passed username and password? I'm using f...

Get values of HttpClient TransportSettings.Credentials in WCF REST 4.0

I have a client wherein I pass in the username, password through network credentials. What I want to do is to pass these two parameters to the service itself for authentication purposes: Example shown below: Client: HttpClient client = new HttpClient("http://localhost:8080/ProductService/"); client.TransportSettings.Credentials = ...

change sender address when sending mail through gmail in c#

I ve used the following code to send mail from my web application using a gmail account.. Can i change the sender address to another address other than original sender(gmail) address.. System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage(); System.Net.NetworkCredential cred = new System.Net.NetworkCredential("sa...