I’m writing a script for which I need to provide some sort of authentication capabilities. I thought that using svnkit for this purpose would be ideal as - to my understanding - it can use SVN credentials and also store them to disk. Sadly It appears I’m unable to understand how svnkit works.
Can someone be so kind and help me out with code snippets that are capable of storing credentials, updating them and actually using them?
After reading the documentation, I tried to write code for storing credentials and came up with this:
SVNWCUtil.createDefaultAuthenticationManager(new File("path/to/where/i/want/credentials"), "username", "password".toCharArray(), true)
However, the behavior of this code is different between svnkit 1.10.2 and 1.8.9. For the older version, there actually is an svn file structure created on disk, however without any credential files. For the newer version there is no file structure.
At the same time, if I try to get back the credentials using this code:
SVNPasswordAuthentication svnCredentials = SVNWCUtil.createDefaultAuthenticationManager(new File("path/to/where/i/want/credentials"), "username", "password".toCharArray(), true).getFirstAuthentication(ISVNAuthenticationManager.PASSWORD, 'some_authentication_realm', SVNURL.parseURIEncoded('some_svn_url'))
I can easily print the credentials regardless of svnkit version using:
println svnCredentials.userName println svnCredentials.passwordValue
So It would seem the credentials do get created in memory, but do not get stored despite using storeAuth=true
Thank you in advance for your time and effort :)