|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISVNAuthenticationManager
The ISVNAuthenticationManager is implemented by manager classes used by SVNRepository drivers for user authentication purposes.
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 ISVNAuthenticationProvider.ACCEPTED
. That will switch on certificate on-the-disk caching.
How to get a default auth manager instance see SVNWCUtil
.
SVNRepository
Field Summary | |
---|---|
static java.lang.String |
PASSWORD
A simple password credential kind ("svn.simple") |
static java.lang.String |
SSH
An ssh credential kind ("svn.ssh") |
static java.lang.String |
SSL
An ssl credential kind ("svn.ssl.client-passphrase") |
static java.lang.String |
USERNAME
A simple username credential kind ("svn.username"). |
Method Summary | |
---|---|
void |
acknowledgeAuthentication(boolean accepted,
java.lang.String kind,
java.lang.String realm,
SVNErrorMessage errorMessage,
SVNAuthentication authentication)
Accepts the given authentication if it was successfully accepted by a repository server, or not if authentication failed. |
void |
acknowledgeTrustManager(javax.net.ssl.TrustManager manager)
Acknowledges the specified trust manager. |
int |
getConnectTimeout(SVNRepository repository)
Returns the connection timeout value in milliseconds which repository
should use in network connection operations. |
SVNAuthentication |
getFirstAuthentication(java.lang.String kind,
java.lang.String realm,
SVNURL url)
Retrieves the first user credential. |
SVNAuthentication |
getNextAuthentication(java.lang.String kind,
java.lang.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. |
int |
getReadTimeout(SVNRepository repository)
Returns the read timeout value in milliseconds which repository should use in
socket read operations. |
javax.net.ssl.TrustManager |
getTrustManager(SVNURL url)
Returns a manager which handles trust data for the specified url . |
boolean |
isAuthenticationForced()
Checks whether client should send authentication credentials to a repository server not waiting for the server's challenge. |
void |
setAuthenticationProvider(ISVNAuthenticationProvider provider)
Sets a custom authentication provider that will provide user credentials for authentication. |
Field Detail |
---|
static final java.lang.String PASSWORD
static final java.lang.String SSH
static final java.lang.String SSL
static final java.lang.String USERNAME
file:///
and svn+ssh://
access schemes.
Method Detail |
---|
void setAuthenticationProvider(ISVNAuthenticationProvider provider)
provider
- an authentication providerISVNProxyManager getProxyManager(SVNURL url) throws SVNException
A default auth manager uses proxy settings from the standard servers file.
url
- a repository location that will be accessed
over the proxy server for which a manager is needed
SVNException
javax.net.ssl.TrustManager getTrustManager(SVNURL url) throws SVNException
url
.
Note: in pre-1.2.0 versions ISVNAuthenticationManager
used to provide ISVNSSLManager
via a method getSSLManager()
which is now replaced by this one. ISVNSSLManager
is no longer used (replaced by TrustManager
).
url
- repository url
SVNException
SVNAuthentication getFirstAuthentication(java.lang.String kind, java.lang.String realm, SVNURL url) 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 |
kind
- a credential kindrealm
- a repository authentication realmurl
- a repository location that is to be accessed
SVNException
SVNAuthentication getNextAuthentication(java.lang.String kind, java.lang.String realm, SVNURL url) throws SVNException
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 |
kind
- a credential kindrealm
- a repository authentication realmurl
- a repository location that is to be accessed
SVNException
void acknowledgeAuthentication(boolean accepted, java.lang.String kind, java.lang.String realm, SVNErrorMessage errorMessage, SVNAuthentication authentication) throws SVNException
accepted
- true if
the credential was accepted by the server,
otherwise falsekind
- a credential kind (PASSWORD
or SSH
or USERNAME
)realm
- a repository authentication realmerrorMessage
- the reason of the authentication failureauthentication
- a user credential to accept/drop
SVNException
void acknowledgeTrustManager(javax.net.ssl.TrustManager manager)
manager
.
manager
- trust manager to acknowledge (one returned by getTrustManager(SVNURL)
)boolean isAuthenticationForced()
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.
int getReadTimeout(SVNRepository repository)
repository
should use in
socket read operations. Socket read operations will block only for this amount of time.
repository
- a repository access driver
int getConnectTimeout(SVNRepository repository)
repository
should use in network connection operations.
repository
- repository access object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |