org.tmatesoft.svn.core.auth
public interface ISVNAuthenticationManager
When an SVNRepository driver is created, you should provide an authentication manager via a call to:
import org.tmatesoft.svn.core.io.SVNRepository; import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; ... SVNRepository repository; ISVNAuthenticationManager authManger; ... repository.setAuthenticationManager(authManager); ...
SVNKit provides a default authentication manager implementation - org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager. This manager has got the following features:
If using the https:// protocol and if no user's authentication provider implementation is set to the
default manager, server certificates are accepted temporarily and therefore are not cached on the disk.
To enable server CAs caching, a user should set an authentication provider implementation which
acceptServerAuthentication()
method must return ACCEPTED. That will switch on certificate on-the-disk caching.
How to get a default auth manager instance see SVNWCUtil.
Version: 1.1.1
See Also: SVNRepository
Field Summary | |
---|---|
static String | PASSWORD
A simple password credential kind ("svn.simple") |
static String | SSH
An ssh credential kind ("svn.ssh") |
static String | SSL
An ssl credential kind ("svn.ssl") |
static String | USERNAME
A simple username credential kind ("svn.username").
|
Method Summary | |
---|---|
void | acknowledgeAuthentication(boolean accepted, String kind, String realm, SVNErrorMessage errorMessage, SVNAuthentication authentication)
Accepts the given authentication if it was successfully accepted by a
repository server, or not if authentication failed. |
SVNAuthentication | getFirstAuthentication(String kind, String realm, SVNURL url)
Retrieves the first user credential.
|
long | getHTTPTimeout(SVNRepository repository)
Returns a connection timeout value.
|
SVNAuthentication | getNextAuthentication(String kind, String realm, SVNURL url)
Retrieves the next user credential if the first try failed.
|
ISVNProxyManager | getProxyManager(SVNURL url)
Returns a proxy manager that keeps settings for that proxy
server over which HTTP requests are send to a repository server.
|
ISVNSSLManager | getSSLManager(SVNURL url)
Returns the SSL manager for secure interracting with a
repository.
|
boolean | isAuthenticationForced()
Checks whether client should send authentication credentials to
a repository server not waiting for the server's challenge.
|
void | setAuthenticationForced(boolean forced)
Specifies the way how credentials are to be supplied to a
repository server.
|
void | setAuthenticationProvider(ISVNAuthenticationProvider provider)
Sets a custom authentication provider that will provide user
credentials for authentication.
|
void | setRuntimeStorage(ISVNAuthenticationStorage storage)
Sets a specific runtime authentication storage manager. |
file:///
and svn+ssh://
access schemes.Parameters: accepted true if the credential was accepted by the server, otherwise false kind a credential kind (PASSWORD or SSH or USERNAME) realm a repository authentication realm errorMessage the reason of the authentication failure authentication a user credential to accept/drop
Throws: SVNException
getNextAuthentication()
and sends the next credential.
For each credential kind
an implementor should return a kind-specific
credential. The following table matches kinds to proper credential classes:
Credential Kind | Credential Class |
PASSWORD | SVNPasswordAuthentication |
SSH | SVNSSHAuthentication |
SSL | SVNSSLAuthentication |
USERNAME | SVNUserNameAuthentication |
Parameters: kind a credential kind realm a repository authentication realm url a repository location that is to be accessed
Returns: the first try user credential
Throws: SVNException
Parameters: repository a repository access driver
Returns: connection timeout value
Since: 1.1
getFirstAuthentication()
and
sends the retrieved credential.
For each credential kind
an implementor should return a kind-specific
credential. The following table matches kinds to proper credential classes:
Credential Kind | Credential Class |
PASSWORD | SVNPasswordAuthentication |
SSH | SVNSSHAuthentication |
SSL | SVNSSLAuthentication |
USERNAME | SVNUserNameAuthentication |
Parameters: kind a credential kind realm a repository authentication realm url a repository location that is to be accessed
Returns: the next try user credential
Throws: SVNException
A default auth manager uses proxy settings from the standard servers file.
Parameters: url a repository location that will be accessed over the proxy server for which a manager is needed
Returns: a proxy manager
Throws: SVNException
A default implementation of ISVNAuthenticationManager returns an SSL manager that uses CA and user certificate files specified in the standard servers file.
Even if the default manager's getSSLManager() method returns
null for the given url
, a secure
context will be created anymore, but, of course no user certificate files are provided
to a server as well as server's certificates are not checked.
Parameters: url a repository location to access
Returns: an appropriate SSL manager
Throws: SVNException
In some cases it may be necessary to send credentials beforehand, not waiting until the server asks to do it itself. To achieve such behaviour an implementor should return true from this routine.
Returns: true if authentication credentials are forced to be sent;false when credentials are to be sent only in response to a server challenge
See Also: ISVNAuthenticationManager
Parameters: forced true to force credentials sending; false to put off sending credentials till a server challenge
See Also: isAuthenticationForced
Parameters: provider an authentication provider
Parameters: storage a custom auth storage manager