|
JavaSVN Home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The ISVNAuthenticationManager is implemented by manager classes used by SVNRepository drivers for user authentication.
When an SVNRepository driver is created (for working with a repository over network), 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); ...
A default auth manager implementation - org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager.
JavaSVN provides a default authentication manager. This manager has got the following features:
If using the https:// protocol and if no user's auth provider is set to the
default manager, accepted (trusted) server certificates are not cached on the disk,
to enable server CAs caching, the user auth provider's acceptServerAuthentication()
should return ISVNAuthenticationProvider.ACCEPTED
.
How to get a default auth manager instance see SVNWCUtil
.
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") |
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. |
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()
Deprecated. |
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. |
Field Detail |
public static final String PASSWORD
public static final String SSH
public static final String SSL
Method Detail |
public void setAuthenticationProvider(ISVNAuthenticationProvider provider)
provider
- an authentication providerpublic ISVNProxyManager 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
public ISVNSSLManager getSSLManager(SVNURL url) 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.
url
- a repository location to access
SVNException
public SVNAuthentication getFirstAuthentication(String kind, String realm, SVNURL url) throws SVNException
getNextAuthentication()
and sends the next credential.
kind
- a credential kind (PASSWORD
or SSH
)realm
- a repository authentication realmurl
- a repository location that is to be accessed
SVNException
public SVNAuthentication getNextAuthentication(String kind, String realm, SVNURL url) throws SVNException
getFirstAuthentication()
and
sends the retrieved credential.
kind
- a credential kind (PASSWORD
or SSH
)realm
- a repository authentication realmurl
- a repository location that is to be accessed
SVNException
public void acknowledgeAuthentication(boolean accepted, String kind, String realm, SVNErrorMessage errorMessage, SVNAuthentication authentication)
accepted
- true if
the credential was accepted by the server,
otherwise falsekind
- a credential kind (PASSWORD
or SSH
)realm
- a repository authentication realmerrorMessage
- the reason of the authentication failureauthentication
- a user credential to accept/droppublic void setRuntimeStorage(ISVNAuthenticationStorage storage)
storage
- a custom auth storage managerpublic boolean isAuthenticationForced()
|
JavaSVN Home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |