68

I am trying to simulate a problem we have with a particular domain ID which has issues accessing a subversion repository. Towards this, I tried a svn checkout with the option --username domain\problematic_ID on another windows machine. But I am not able to reproduce the problem as the checkout still succeeds using my own ID. This led me to wonder if SVN caches user authentication data in more than one place and if so where.

I have cleared the auth directory in the application data area, changed the options in the config file to disable caching of user auth data - but to no avail. The system does not even prompt me for the new user name and password, but simply checks out with the old ID.(I know it is the old ID in use by looking through the SVN logs). I am obviously missing something here -- but what? :-(

Does anyone know?

The subversion client version I use is 1.4.6(r28521)

hichris123
  • 10,145
  • 15
  • 56
  • 70
Critical Skill
  • 2,528
  • 2
  • 17
  • 22

6 Answers6

120
  • On Unix, it's in $HOME/.subversion/auth.

  • On Windows, I think it's: %APPDATA%\Subversion\auth.

bahrep
  • 29,961
  • 12
  • 103
  • 150
Nikola Kotur
  • 1,954
  • 3
  • 13
  • 15
  • 18
    On Windows Server 2008, I found it under C:\Users\\AppData\Roaming\Subversion\auth – Ophidian Nov 09 '11 at 14:46
  • on a iSeries, it is `jsvn` and I get `/home/USER/.subversion/auth/svn.simple/_very_long_hexa_` which contains my id... – Sandburg Dec 07 '18 at 09:49
16

It sounds like you are doing everything exactly as the client credential section of the Subversion book suggests. The only thing I can think of is that the server isn't asking for the username and password because is getting it from somewhere else.

bahrep
  • 29,961
  • 12
  • 103
  • 150
Tim Kryger
  • 11,166
  • 4
  • 52
  • 41
  • 7
    This is a *very* old link. – RedGlyph Oct 22 '09 at 07:01
  • 7
    The server does not always prompt/challenge the client for information. Sometimes (based on the configuration ) the server accepts the "basic authentication" the one that was used to login to the client host for example. So --username does not ALWAYS produce a prompt unless configured to do so! I figured this out after much struggle and thought I'd record it here for reference. Thanks for the hint. – Critical Skill Oct 26 '09 at 03:34
  • it's 2016 and deleting the cache file generated in svn.simple still works... ++ – beauXjames Jun 24 '16 at 18:44
10

Which version do you use?

Here is the documentation on credential caching, for the latest (1.6 as of writing).

On Windows, the Subversion client stores passwords in the %APPDATA%/Subversion/auth/ directory. On Windows 2000 and later, the standard Windows cryptography services are used to encrypt the password on disk. Because the encryption key is managed by Windows and is tied to the user's own login credentials, only the user can decrypt the cached password. (Note that if the user's Windows account password is reset by an administrator, all of the cached passwords become undecipherable. The Subversion client will behave as though they don't exist, prompting for passwords when required.)

Also, be aware that a few changes occurred in version 1.6 regarding password storage.

RedGlyph
  • 11,309
  • 6
  • 37
  • 49
  • You can still access the documentation for this version (http://svnbook.red-bean.com/en/1.4/svn.serverconfig.netmodel.html#svn.serverconfig.netmodel.credcache) but the path remains the same. TortoiseSVN allows you to clear authentication data from the GUI if that's of any help. Here, if I remove the files mentioned above and in the other posts, I'm asked my credentials next time they are needed (as per access control policy file). – RedGlyph Oct 22 '09 at 09:37
  • Just out of curiosity, could you precise how you know the ID used to proceed to the checkout? You mention the SVN logs, which ones? – RedGlyph Oct 22 '09 at 09:40
  • @RedGlyph: I have turned on some custom logging for subversion actions to give me more meaningful reports. You can either do this in http.conf file (methinks) but in our setup we have a seperate conf file for the apache part of the subversion configuration. If you add a line thus - CustomLog logs/svn_log "%t %u %{SVN-ACTION}e" env=SVN-ACTION just after the section in the conf file, you can get a nice tidy logging of some SVN actions. See here for details. (under operational logging)http://subversion.tigris.org/svn_1.3_releasenotes.html – Critical Skill Oct 22 '09 at 10:22
6

I know I'm uprising a very old topic, but after a couple of hours struggling with this very problem and not finding a solution anywhere else, I think this is a good place to put an answer.

We have some Build Servers WindowsXP based and found this very problem: svn command line client is not caching auth credentials.

We finally found out that we are using Cygwin's svn client! not a "native" Windows. So... this client stores all the auth credentials in /home/<user>/.subversion/auth

This /home directory in Cygwin, in our installation is in c:\cygwin\home. AND: the problem was that the Windows user that is running svn did never ever "logged in" in Cygwin, and so there was no /home/<user> directory.

A simple "bash -ls" from a Windows command terminal created the directory, and after the first access to our SVN server with interactive prompting for access credentials, alás, they got cached.

So if you are using Cygwin's svn client, be sure to have a "home" directory created for the local Windows user.

Community
  • 1
  • 1
niglesias
  • 437
  • 7
  • 16
3

On Windows, you can find it under.

%USERPROFILE%\AppData\Roaming\Subversion\auth\svn.simple
(same as below)
%APPDATA%\Roaming\Subversion\auth\svn.simple

There may be multiple files under this directory, depending upon the repos you are contributing to. You can assume this as one file for each svn server. You can open the file with any text editor and make sure you are going to delete the correct file.

Manohar
  • 653
  • 1
  • 10
  • 15
3

Read SVNBook | Client Credentials.

With modern SVN you can just run svn auth to display the list of cached credentials. Don't forget to make sure that you run up-to-date SVN client version because svn auth was introduced in version 1.9. The last line will specify the path to credential store which by default is %APPDATA%\Subversion\auth on Windows and ~/.subversion/auth/ on Unix-like systems.

PS C:\Users\MyUser> svn auth
------------------------------------------------------------------------
Credential kind: svn.simple
Authentication realm: <https://svn.example.local:443> VisualSVN Server
Password cache: wincrypt
Password: [not shown]
Username: user

Credentials cache in 'C:\Users\MyUser\AppData\Roaming\Subversion' contains 5 credentials
bahrep
  • 29,961
  • 12
  • 103
  • 150