views:

564

answers:

1

I am writing some C# code to perform multiple commits to SVN in one pass, much like the tool svnmucc. So far I've been using SharpSvn to do the rest of the necessary communication with SVN, so I'm thinking I can take advantage of it to accomplish the following:

How can I get the credentials (username, password) that are used by SharpSvn?

I'd like to do something like this:

using (SvnClient svnClient = new SvnClient())
{
    SomeFictitiousCredentialsClass credentials = svnClient.Authentication.FictitiousGetCachedCredentialsMethod();

    // Call my code that performs svnmucc-like work here, passing username and password
    // obtained from 'credentials' variable.
}
+1  A: 

Sharpsvn doesn't have an api that provides you the credentials from Subversion. It mostly implements the libsvn_client api, and at this level there is no access to this data.

SharpSvn gets a callback from the subversion libraries when these need credentials; in most cases after the builtin password store fails to authenticate.

If your svnmucc code also uses the Subversion apis, you can just plugin the subversion predefined authentication handlers..

SharpSvn itself doesn't have svnmucc support yet. (There was some talk about somebody who liked to add this to SharpSvn, but I haven't got any news about this lately)

Bert Huijben