0

I am developing a intranet web application using ASP.NET MVC 4 that uses Windows-Authentication. I have integrated SharpSVN to do some SVN interactions and initially I was planning to use the username and the password from Windows Authentication, to authenticate the user on SVN, but as I found out, you can't get the password of the user when using Windows Authentication.

So is there any way to achieve this? To make SharpSVN use the Windows Authentication from the ASP.NET?

Thank you.

Cosmin
  • 2,840
  • 5
  • 32
  • 50

1 Answers1

1

Look into identity inpersonation this will let you run each windows authenticated user in a thread under that user account. This will mean, that your clients must use machines that belong to the same AD domain as the Web server and as the SVN server.

juhan_h
  • 3,965
  • 4
  • 29
  • 35
  • I had a look at impersonation but I can't see how this would help me to set the username and password to the SharpSvn client.You're saying that if I use impersonation then I don't have to run this line of code: client.Authentication.DefaultCredentials = new System.Net.NetworkCredential("user", "password"); ? – Cosmin Aug 09 '13 at 07:15
  • This will not help you set the password. You will never be able to get the password out of a WindowsAuthenticated user unless you explicity ask it in a form. Impersonation would let you run the thread on the web server under as a concrete user thus it will make your SharpSVN client run under that users credentials. If your SVN repo supports authentication throud an AD domain this should suffice. You would not have to provide User/Pass at all. – juhan_h Aug 09 '13 at 07:21