Questions tagged [defaultnetworkcredentials]

A property of Microsoft's .NET Framework that returns the security context of the current user or application.

For Windows' applications this property will return the username, password & domain of the user running the application. When used by ASP.NET applications returned credentials are those of the logged in user or the user being impersonated.

Full details on MSDN.

33 questions
36
votes
2 answers

DefaultNetworkCredentials or DefaultCredentials

Which one am I supposed to use when I need to supply a credential to a proxy (local or in Network)? What's the exact difference between these two?
dr. evil
  • 26,944
  • 33
  • 131
  • 201
32
votes
6 answers

How do you get credentials (NetworkCredential) of currently logged in user?

I'm writing some code to utilise a 3rd party component, and I need to supply an object which implements ICredentials when I start to use it. If I write the following... var credential = new NetworkCredential("MyUsername", "MyPassword"); ...and pass…
Black Light
  • 2,358
  • 5
  • 27
  • 49
30
votes
3 answers

Using DefaultCredentials and DefaultNetworkCredentials

We're having a hard time figuring how these credentials objects work. In fact, they may not work how we expected them to work. Here's an explanation of the current issue. We got 2 servers that needs to talk with each other through webservices. The…
25
votes
1 answer

WebClient accessing page with credentials

I am trying to access a webpage on a same domain / same asp.net application, that is password protected. Credentials are the same both for webpage firing this call and webpage being accessed. Here is the code, and I don't know why I always end up…
mko
  • 6,638
  • 12
  • 67
  • 118
5
votes
2 answers

when using "default proxy" where does the username/password come from?

The "WebClient" class (and ClickOnce also) can use default proxy settings (e.g. put in application.config), however: Where does the username / password come from? (I can't see a setting in the XML config - see below). Can the application be…
Greg
  • 34,042
  • 79
  • 253
  • 454
4
votes
1 answer

Where does DefaultCredentials pull out "UserName" as a username for a web request?

There's a WinForms desktop application which tries to connect to SSRS service. The Reporting Server is configured to accept both Active Directory credential logins and also a credential for specific user for reporting purposes. In the following code…
3
votes
2 answers

How to get Alfresco login ticket without user password, but with impersonating user with user principal name (UPN)

I'm writing a DLL that has function for getting Alfresco login ticket without using user password, using only a user principal name (UPN). I’m calling alfresco REST API service /wcservice. I use NTLM in Alfresco. I’m impersonating users using…
3
votes
1 answer

C# HttpWebRequest with Proxy Credentials not passing credentials to proxy server

I am currently following something similar to this: HttpWebRequest myWebRequest = (HttpWebRequest) WebRequest.Create("http://www.microsoft.com"); IWebProxy proxy = myWebRequest.Proxy; Uri newUri = new Uri(proxyAddress); myProxy.Address =…
user2186725
  • 31
  • 1
  • 1
  • 3
2
votes
0 answers

C# How to set up Webproxy with NTLM Authtification

i wanna set up a webclient with a NTLM authtification proxy, but i have some Problems to hand over the DefaultCredentials. This is my current solution, but it doesn’t work. textBox.Text = ""; IWebProxy proxy =…
2
votes
0 answers

CredentialCache.DefaultNetworkCredentials not returning currently logged in user. ExchangeService

I'm trying to pass the currently logged on user's credentials to the Exchange Web Services Managed API. Not trying to inspect them or check the values, just simply use them to make the call. The application is using windows authentication and the…
2
votes
1 answer

Get Default Credentials From A Windows Service

I want to be able to get the default credentials from a within a windows service. However if I call var credentials = CredentialCache.DefaultCredentials; Or var networkCredentials = CredentialCache.DefaultNetWorkCredentials; The NetworkCredential…
2
votes
0 answers

NSURLCredentialStorage not work in iOS 7

hope i'm not unique iOS 7 victim :) I have an application that synchronize its database with my web service, in my synchronization flow there is 14 call to web services, using Windows Authentication. All this call are inside a separate thread. I…
2
votes
1 answer

Powershell: Discover default network credentials when launched from runas /netonly

I am looking for a way to capture the network credentials of the current session into a variable that I can pass later... The point is to execute commands on a foreign domain that I have account access/privileges to, but there is not a trust between…
1
vote
0 answers

How can I save network credentials to the Windows credentials cache/vault?

I am evaluating a 3rd party API WebDAV.NET for gaining access to SharePoint web folders. This API accepts the standard .Net network credentials and gives me two options: ICredentials credential =…
1
vote
2 answers

How to pass credentials from one web service to another?

I currently have an app that calls a web service(WS1), which in turn calls another web service(WS2) to get/set information on the server hosted on WS2. I would like to be able to pass in the user credentials into WS2 from WS1 as if there was an…
1
2 3