public class BasicAuthenticationManager extends Object implements ISVNAuthenticationManager, ISVNProxyManagerEx, ISVNSSHHostVerifier
This manager does not use authentication providers (ISVNAuthenticationProvider) but only those credentials that was supplied to its constructor. Also this manager never caches credentials.
This manager is not used in SVNKit internals. You may use a default
manager (how to get it read javadoc for ISVNAuthenticationManager
),
this basic manager or implement your own one.
ISVNAuthenticationProvider
PASSWORD, SSH, SSL, USERNAME
Constructor and Description |
---|
BasicAuthenticationManager(String userName,
File keyFile,
String passphrase,
int portNumber)
Deprecated.
Use
newInstance(String, File, char[], int) method |
BasicAuthenticationManager(String userName,
String password)
Deprecated.
Use
newInstance(String, char[]) method |
BasicAuthenticationManager(SVNAuthentication[] authentications)
Creates an auth manager given user credentials to use.
|
Modifier and Type | Method and Description |
---|---|
void |
acknowledgeAuthentication(boolean accepted,
String kind,
String realm,
SVNErrorMessage errorMessage,
SVNAuthentication authentication)
Does nothing.
|
static void |
acknowledgeAuthentication(boolean accepted,
String kind,
String realm,
SVNErrorMessage errorMessage,
SVNAuthentication authentication,
SVNURL accessedURL,
ISVNAuthenticationManager authManager)
Utility method to acknowledge successful or failed authentication attempt
|
void |
acknowledgeProxyContext(boolean accepted,
SVNErrorMessage errorMessage)
Does nothing.
|
void |
acknowledgeTrustManager(TrustManager manager)
Does nothing.
|
void |
dismissSensitiveData()
Dismiss cached sensitive data (e.g.
|
int |
getConnectTimeout(SVNRepository repository)
Returns connection timeout value.
|
SVNAuthentication |
getFirstAuthentication(String kind,
String realm,
SVNURL url)
Returns the first user's authentication credentials.
|
SVNAuthentication |
getNextAuthentication(String kind,
String realm,
SVNURL url)
Returns next user authentication credentials.
|
String |
getProxyHost()
Returns the proxy host name.
|
ISVNProxyManager |
getProxyManager(SVNURL url)
Returns itself as a proxy manager.
|
String |
getProxyPassword()
Deprecated.
|
char[] |
getProxyPasswordValue()
Returns the password to authenticate against the proxy server.
|
int |
getProxyPort()
Returns the proxy port number.
|
String |
getProxyUserName()
Returns the proxy user name.
|
int |
getReadTimeout(SVNRepository repository)
Returns connection timeout value.
|
TrustManager |
getTrustManager(SVNURL url)
Returns null.
|
boolean |
isAuthenticationForced()
Tells whether authentication should be tried despite not being challenged from the server yet.
|
static BasicAuthenticationManager |
newInstance(String userName,
char[] password)
Creates an auth manager given a user credential - a username
and password.
|
static BasicAuthenticationManager |
newInstance(String userName,
File keyFile,
char[] passphrase,
int portNumber)
Creates an auth manager given a user credential - a username and
an ssh private key.
|
static BasicAuthenticationManager |
newInstance(SVNAuthentication[] credentials)
Creates an auth manager given user credentials to use.
|
void |
setAuthenticationForced(boolean forced)
Sets whether authentication should be forced or not.
|
void |
setAuthenticationProvider(ISVNAuthenticationProvider provider)
Does nothing.
|
void |
setAuthentications(SVNAuthentication[] authentications)
Sets the given user credentials to this manager.
|
void |
setProxy(String proxyHost,
int proxyPort,
String proxyUserName,
char[] proxyPassword)
Sets a proxy server context to this manager.
|
void |
setProxy(String proxyHost,
int proxyPort,
String proxyUserName,
String proxyPassword)
Deprecated.
|
void |
verifyHostKey(String hostName,
int port,
String keyAlgorithm,
byte[] hostKey) |
public BasicAuthenticationManager(String userName, String password)
newInstance(String, char[])
methoduserName
- a usernamepassword
- a passwordpublic BasicAuthenticationManager(String userName, File keyFile, String passphrase, int portNumber)
newInstance(String, File, char[], int)
methoduserName
- a usernamekeyFile
- a private key filepassphrase
- a password to the private keyportNumber
- a port number over which an ssh tunnel is establishedpublic BasicAuthenticationManager(SVNAuthentication[] authentications)
authentications
- user credentialspublic static BasicAuthenticationManager newInstance(String userName, char[] password)
userName
- a usernamepassword
- a passwordpublic static BasicAuthenticationManager newInstance(String userName, File keyFile, char[] passphrase, int portNumber)
userName
- a usernamekeyFile
- a private key filepassphrase
- a password to the private keyportNumber
- a port number over which an ssh tunnel is establishedpublic static BasicAuthenticationManager newInstance(SVNAuthentication[] credentials)
credentials
- user credentialspublic static void acknowledgeAuthentication(boolean accepted, String kind, String realm, SVNErrorMessage errorMessage, SVNAuthentication authentication, SVNURL accessedURL, ISVNAuthenticationManager authManager) throws SVNException
SVNException
public void setAuthentications(SVNAuthentication[] authentications)
authentications
- user credentialspublic void setProxy(String proxyHost, int proxyPort, String proxyUserName, String proxyPassword)
proxyHost
- a proxy server hostnameproxyPort
- a proxy server portproxyUserName
- a username to supply to a proxy machineproxyPassword
- a password to supply to a proxy machinepublic void setProxy(String proxyHost, int proxyPort, String proxyUserName, char[] proxyPassword)
proxyHost
- a proxy server hostnameproxyPort
- a proxy server portproxyUserName
- a username to supply to a proxy machineproxyPassword
- a password to supply to a proxy machinepublic SVNAuthentication getFirstAuthentication(String kind, String realm, SVNURL url) throws SVNException
getFirstAuthentication
in interface ISVNAuthenticationManager
kind
- credentials kind; valid kinds are ISVNAuthenticationManager.SSH
,
ISVNAuthenticationManager.PASSWORD
, ISVNAuthenticationManager.USERNAME
,
ISVNAuthenticationManager.SSL
, ISVNAuthenticationManager.USERNAME
realm
- authentication realmurl
- repository urlSVNException
- exception with SVNErrorCode.RA_NOT_AUTHORIZED
error code - in case of invalid kind
public SVNAuthentication getNextAuthentication(String kind, String realm, SVNURL url) throws SVNException
getFirstAuthentication(String, String, SVNURL)
failed to authenticate the user.getNextAuthentication
in interface ISVNAuthenticationManager
kind
- credentials kind; valid kinds are ISVNAuthenticationManager.SSH
,
ISVNAuthenticationManager.PASSWORD
, ISVNAuthenticationManager.USERNAME
,
ISVNAuthenticationManager.SSL
, ISVNAuthenticationManager.USERNAME
realm
- authentication realmurl
- repository urlSVNException
- exception with SVNErrorCode.RA_NOT_AUTHORIZED
error code - in case of invalid kind
public void setAuthenticationProvider(ISVNAuthenticationProvider provider)
setAuthenticationProvider
in interface ISVNAuthenticationManager
provider
- public ISVNProxyManager getProxyManager(SVNURL url) throws SVNException
getProxyManager
in interface ISVNAuthenticationManager
url
- a repository location that will be accessed
over the proxy server for which a manager is neededSVNException
public TrustManager getTrustManager(SVNURL url) throws SVNException
getTrustManager
in interface ISVNAuthenticationManager
url
- repository urlSVNException
public void acknowledgeAuthentication(boolean accepted, String kind, String realm, SVNErrorMessage errorMessage, SVNAuthentication authentication)
acknowledgeAuthentication
in interface ISVNAuthenticationManager
accepted
- kind
- realm
- errorMessage
- authentication
- public void acknowledgeTrustManager(TrustManager manager)
acknowledgeTrustManager
in interface ISVNAuthenticationManager
manager
- public boolean isAuthenticationForced()
setAuthenticationForced(boolean)
.isAuthenticationForced
in interface ISVNAuthenticationManager
public void setAuthenticationForced(boolean forced)
forced
- authentication force flagisAuthenticationForced()
public String getProxyHost()
getProxyHost
in interface ISVNProxyManager
setProxy(String, int, String, String)
methodpublic int getProxyPort()
getProxyPort
in interface ISVNProxyManager
setProxy(String, int, String, String)
methodpublic String getProxyUserName()
getProxyUserName
in interface ISVNProxyManager
setProxy(String, int, String, String)
methodpublic String getProxyPassword()
getProxyPasswordValue()
getProxyPassword
in interface ISVNProxyManager
setProxy(String, int, String, String)
methodpublic char[] getProxyPasswordValue()
getProxyPasswordValue
in interface ISVNProxyManagerEx
setProxy(String, int, String, String)
methodpublic void acknowledgeProxyContext(boolean accepted, SVNErrorMessage errorMessage)
acknowledgeProxyContext
in interface ISVNProxyManager
accepted
- errorMessage
- public int getReadTimeout(SVNRepository repository)
http
or https
access operations. If repository
uses a different access protocol,
the return value will be 0.getReadTimeout
in interface ISVNAuthenticationManager
repository
- repository access objectpublic int getConnectTimeout(SVNRepository repository)
http
or https
access operations. If repository
uses a different access protocol,
the return value will be 0.getConnectTimeout
in interface ISVNAuthenticationManager
repository
- repository access objectpublic void verifyHostKey(String hostName, int port, String keyAlgorithm, byte[] hostKey) throws SVNException
verifyHostKey
in interface ISVNSSHHostVerifier
SVNException
public void dismissSensitiveData()
Copyright © 2022. All rights reserved.