Package org.tmatesoft.svn.core.auth
Interface ISVNAuthenticationProvider
- All Known Implementing Classes:
DefaultSVNAuthenticationManager.CacheAuthenticationProvider
,DefaultSVNAuthenticationManager.DumbAuthenticationProvider
,DefaultSVNPersistentAuthenticationProvider
,JavaHLAuthenticationProvider
,JavaHLAuthenticationProvider
,SVNConsoleAuthenticationProvider
public interface ISVNAuthenticationProvider
The ISVNAuthenticationProvider interface is implemented by user
credentials providers. Such a provider is set to an authentication manager
calling
setAuthenticationProvider()
.
When a repository server pulls user's credentials, an SVNRepository driver
asks the registered ISVNAuthenticationManager for credentials. The auth manager in its turn
will ask the registered auth provider for credentials.
ISVNAuthenticationProvider may be implemented to keep a list of credentials, for example, there is such a default SVNKit implementation (that comes along with a default implementation of ISVNAuthenticationManager - org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager), that saves credentials in and retrieves them from the in-memory cache only during runtime (not on the disk); or the default one that uses the auth area cache (read the Subversion book chapter).
- Since:
- 1.2
- Version:
- 1.3
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Denotes that a user credential is accepted by a server and will be cached on the disk.static final int
Denotes that a user credential is accepted by a server and will be cached only during runtime, not on the disk.static final int
Denotes that a user credential is rejected by a server. -
Method Summary
Modifier and TypeMethodDescriptionint
acceptServerAuthentication
(SVNURL url, String realm, Object certificate, boolean resultMayBeStored) Checks a server authentication certificate and whether accepts it (if the client trusts it) or not.requestClientAuthentication
(String kind, SVNURL url, String realm, SVNErrorMessage errorMessage, SVNAuthentication previousAuth, boolean authMayBeStored) Returns a next user credential of the specified kind for the given authentication realm.
-
Field Details
-
REJECTED
static final int REJECTEDDenotes that a user credential is rejected by a server.- See Also:
-
ACCEPTED_TEMPORARY
static final int ACCEPTED_TEMPORARYDenotes that a user credential is accepted by a server and will be cached only during runtime, not on the disk.- See Also:
-
ACCEPTED
static final int ACCEPTEDDenotes that a user credential is accepted by a server and will be cached on the disk.- See Also:
-
-
Method Details
-
requestClientAuthentication
SVNAuthentication requestClientAuthentication(String kind, SVNURL url, String realm, SVNErrorMessage errorMessage, SVNAuthentication previousAuth, boolean authMayBeStored) Returns a next user credential of the specified kind for the given authentication realm.If this provider has got more than one credentials (say, a list of credentials), to get the first one of them
previousAuth
is set to null.- Parameters:
kind
- a credential kind (for example, like those defined inISVNAuthenticationManager
)url
- a repository location that is to be accessedrealm
- a repository authentication realm (host, port, realm string)errorMessage
- the recent authentication failure error messagepreviousAuth
- the credential that was previously retrieved (to tell if it's not accepted)authMayBeStored
- if true then the returned credential can be cached, otherwise it won't be cached anyway- Returns:
- a next user credential
-
acceptServerAuthentication
int acceptServerAuthentication(SVNURL url, String realm, Object certificate, boolean resultMayBeStored) Checks a server authentication certificate and whether accepts it (if the client trusts it) or not.This method is used by an SSL manager (see
DefaultSVNSSLTrustManager
).- Parameters:
url
- a repository location that is accessedrealm
- a repository authentication realm (host, port, realm string)certificate
- a server certificate objectresultMayBeStored
- if true then the server certificate can be cached, otherwise not- Returns:
- the result of the certificate check (
REJECTED
,ACCEPTED_TEMPORARY
, orACCEPTED
)
-