2

I am using SharpSvn library.

I am developing a tool with a lock functionality. To simulate different lock owners, I like to use other credentials. Unfortunately my code does not work. It looks like SharpSvn does not take into account the provided network credential. When I provide an incorrect one (e.g. bad password) it does not throw an exception.

Any ideas to fix my issue?

using (var client = new SvnClient())
        {
            client.Authentication.Clear();
            client.Authentication.DefaultCredentials = new NetworkCredential(userName, password, domain);

            client.Authentication.SslServerTrustHandlers += delegate (object sender, SvnSslServerTrustEventArgs e)
            {
                e.AcceptedFailures = e.Failures;
                e.Save = true;
            };
        }

Edit

Some extra info

  • The Visual SVN server uses Windows authentication - Integrated Window Authentication
  • client.Authentication.DefaultCredentials is null
  • client.Configuration properties

client configuration

bahrep
  • 29,961
  • 12
  • 103
  • 150
BertAR
  • 425
  • 3
  • 18
  • Which kind of server are you using? Does the server uses some kind of "Windows authentication"? – royalTS Dec 07 '17 at 06:38
  • @royalTS I've updated my post. SVN server uses Integrated Window Authentication – BertAR Dec 07 '17 at 12:31
  • 1
    Then this won´t work since the SVN server already checks the credentials when Windows creates the connection. If you need to specify different credentials you can use the Windows Credential Manager. In this answer you will find some more information: https://stackoverflow.com/a/19813080/3809520 – royalTS Dec 07 '17 at 14:00

0 Answers0