¿Alguien me puede decir cómo autenticar usuarios (usuarios SVN) para un repositorio usando la Biblioteca SharpSVN? Ese repositorio solo debe ser comprometido por esos usuarios. GraciasSVN Repository Authentication using SharpSVN
Respuesta
Utilice las propiedades Autenticar de SVNClient
:
client.Authentication.Clear(); // Clear a previous authentication
client.Authentication.DefaultCredentials = new System.Net.NetworkCredential("user", "password");
también puede anular los errores de certificado SSL mediante la adición de un controlador de eventos para SslServerTrustHandlers
así:
SVN_Conn.Authentication.SslServerTrustHandlers += new EventHandler<SharpSvn.Security.SvnSslServerTrustEventArgs>(SVN_SSL_Override);
static void SVN_SSL_Override(object sender, SharpSvn.Security.SvnSslServerTrustEventArgs e)
{
e.AcceptedFailures = e.Failures;
e.Save = true;
}
Solo para que se haya mencionado: No llame a 'client.authentication.clear()' después de suscribirse al evento, de lo contrario, no se activará. – SanBen
client.Authentication.ForceCredentials("user", "password");
Para aquellos de usted que no desea deshacerse de sus credenciales predeterminadas (si está ejecutando TortoiseSVN en la misma máquina).
En mi caso, el servidor SVN ejecutaba VisualSVN Server 3.5.3 con la Autenticación de Windows integrada habilitada. Usando SharpSvn 1.9004.3879.127, el cliente SVN trató de usar la autenticación de Windows, incluso cuando he configurado con un nombre de usuario y contraseña:
client = new SvnClient();
client.Authentication.Clear(); //Prevents saving/loading config to/from disk
client.Authentication.DefaultCredentials = new NetworkCredential("username", "password");
Esto dio como resultado el siguiente error cuando el código de la aplicación se ejecuta por un usuario de Windows que didn 't tienen acceso al repositorio:
SvnRepositoryIOException: No se puede conectar a un repositorio en la URL' https://mysvnserver/svn/reponame '
he arreglado esto only allowing basic
and digest
authentication:
client = new SvnClient();
client.Configuration.SetOption("servers", "global", "http-auth-types", "basic;digest");
client.Authentication.Clear(); // Prevents saving/loading config to/from disk
client.Authentication.DefaultCredentials = new NetworkCredential("username", "password");
- 1. CouchDb read authentication using lists
- 2. SVN Repository Search
- 3. Http Basic Authentication in Java using HttpClient?
- 4. git-svn display svn repository url
- 5. Issue FORM POST Request From PHP using HTTP Basic Authentication
- 6. Agregar archivo usando SharpSVN
- 7. Mirror SVN Repository [Proxying de escritura]
- 8. Nuking huge file in svn repository
- 9. SharpSVN y C# Problema
- 10. ¿Cómo puedo crear una rama en svn usando SharpSVN
- 11. ¿Cómo puedo comenzar con SharpSVN?
- 12. SVN Repository Structure - ¿Por qué es esto mejor?
- 13. XCode4 agregar Repository Host inalcanzable?
- 14. SharpSVN Ejemplo Program Crashes
- 15. SharpSVN leyó TODOS los nombres de archivo
- 16. A Repository Factory Class
- 17. Cómo obtener la lista de archivos modificados en SharpSVN (como svn diff --summarize --xml)
- 18. Restful API authentication recommendation?
- 19. DDD Authentication Service
- 20. Siteminder Authentication y Android
- 21. Demystifying Web Authentication
- 22. Rails authentication plugin recommendation
- 23. burying authentication spring security
- 24. WCF and Kerberos Authentication
- 25. WCF REST RequestInterceptor authentication
- 26. RESTful-Authentication or Authlogic?
- 27. Repository Commit Msg Etiquette
- 28. gcc error message repository
- 29. Try Catch in Repository
- 30. git repository cloning logging
Debe marcarse como la mejor respuesta. Trabajó para mí también, gracias! – jocull
sí funcionó para mí también, gracias Bertrand :) – picnic4u
Esto no funciona para mí, ¿hay algún requisito previo para esto? –