1

I want to create a NetworkCredential based on the logged in user like:

var cred = new NetworkCredential("username", "password", "domain");

Usually the code is running on a system which the user is logged in using his/her password. So I don't want to get the password again. My question has 2 parts:

Question 1. Is there a way to get the current Credential for Desktop applications? Something like:

var cred = NetworkCredential.Current;

Question 2. In a web SPA application, how can I pass the credential to the server via WebApi so I can do the work using his/her credential?

mehrandvd
  • 8,806
  • 12
  • 64
  • 111
  • username and password are stored in database? – Krunal Patil May 22 '14 at 07:35
  • @KrunalPatil No, the scenario is this: Users Logged in using his/her username and password, and then runs the desktop application or navigates to a web page. I want to use the existing credential without asking username and password from the user redundantly. – mehrandvd May 22 '14 at 07:41
  • 3
    Check [this](http://stackoverflow.com/q/949340/982431) out to answer your first question. – HuorSwords May 22 '14 at 07:42
  • @HuorSwords Thanks, that helps for the first part. Any idea about the second question? – mehrandvd May 22 '14 at 09:11
  • Perhaps [this one](http://stackoverflow.com/a/12675503/982431) show you the way... – HuorSwords May 22 '14 at 10:20

0 Answers0