HttpWebRequest authentication problem
-
Hello, I am trying to make an ASP.NET application that uploads a file to a server on a domain. When I provide my username and password to the application, I can upload but, I need to use credentials who uses the web application that time. I am using HttpWebRequest object and tried CredentialCache.DefaultCredentials but it didn't work. Because of security rules in my company, I have to exclude passwords in my app. How do I get NetworkCredentials of the current user? I couldn't find any solutions? Please help. Thanks, Can DOĞU.
-
Hello, I am trying to make an ASP.NET application that uploads a file to a server on a domain. When I provide my username and password to the application, I can upload but, I need to use credentials who uses the web application that time. I am using HttpWebRequest object and tried CredentialCache.DefaultCredentials but it didn't work. Because of security rules in my company, I have to exclude passwords in my app. How do I get NetworkCredentials of the current user? I couldn't find any solutions? Please help. Thanks, Can DOĞU.
candogu wrote:
How do I get NetworkCredentials of the current user?
Look into impersonation, Using IIS Authentication with ASP.NET Impersonation[^].
There are only 10 types of people in the world, those who understand binary and those who don't.
-
candogu wrote:
How do I get NetworkCredentials of the current user?
Look into impersonation, Using IIS Authentication with ASP.NET Impersonation[^].
There are only 10 types of people in the world, those who understand binary and those who don't.
-
Hello, I am trying to make an ASP.NET application that uploads a file to a server on a domain. When I provide my username and password to the application, I can upload but, I need to use credentials who uses the web application that time. I am using HttpWebRequest object and tried CredentialCache.DefaultCredentials but it didn't work. Because of security rules in my company, I have to exclude passwords in my app. How do I get NetworkCredentials of the current user? I couldn't find any solutions? Please help. Thanks, Can DOĞU.
You should be able get the identity using
HttpContext.Current.User.Identity
-
Hello, I am trying to make an ASP.NET application that uploads a file to a server on a domain. When I provide my username and password to the application, I can upload but, I need to use credentials who uses the web application that time. I am using HttpWebRequest object and tried CredentialCache.DefaultCredentials but it didn't work. Because of security rules in my company, I have to exclude passwords in my app. How do I get NetworkCredentials of the current user? I couldn't find any solutions? Please help. Thanks, Can DOĞU.
The fact that you need to enter credentials (assuming in a pop-up box) shows that basic authentication is being used. As mentioned you need to use Windows Authentication\Impersonation....it varies depending on your version of IIS. It won't work on all browsers\network configurations though so it's hard to know if you just don't have it configured, or if your particular situation doesn't allow it. Google for more info.