public interface ISVNAuthenticationProvider
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).
ISVNAuthenticationManager
,
SVNRepository
Modifier and Type | Field and Description |
---|---|
static int |
ACCEPTED
Denotes that a user credential is accepted by a server and will be
cached on the disk.
|
static int |
ACCEPTED_TEMPORARY
Denotes that a user credential is accepted by a server and will be
cached only during runtime, not on the disk.
|
static int |
REJECTED
Denotes that a user credential is rejected by a server.
|
Modifier and Type | Method and Description |
---|---|
int |
acceptServerAuthentication(SVNURL url,
java.lang.String realm,
java.lang.Object certificate,
boolean resultMayBeStored)
Checks a server authentication certificate and whether accepts it
(if the client trusts it) or not.
|
SVNAuthentication |
requestClientAuthentication(java.lang.String kind,
SVNURL url,
java.lang.String realm,
SVNErrorMessage errorMessage,
SVNAuthentication previousAuth,
boolean authMayBeStored)
Returns a next user credential of the specified kind for the given
authentication realm.
|
static final int REJECTED
static final int ACCEPTED_TEMPORARY
static final int ACCEPTED
SVNAuthentication requestClientAuthentication(java.lang.String kind, SVNURL url, java.lang.String realm, SVNErrorMessage errorMessage, SVNAuthentication previousAuth, boolean authMayBeStored)
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.
kind
- a credential kind (for example, like those defined in
ISVNAuthenticationManager
)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 anywayint acceptServerAuthentication(SVNURL url, java.lang.String realm, java.lang.Object certificate, boolean resultMayBeStored)
This method is used by an SSL manager (see DefaultSVNSSLTrustManager
).
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 notREJECTED
, ACCEPTED_TEMPORARY
, or ACCEPTED
)Copyright © 2004-2012 TMate Software Ltd. All Rights Reserved.