/** * Utility method to acknowledge successful or failed authentication attempt */ public static void acknowledgeAuthentication(boolean accepted, String kind, String realm, SVNErrorMessage errorMessage, SVNAuthentication authentication, SVNURL accessedURL, ISVNAuthenticationManager authManager) throws SVNException { if (authManager instanceof ISVNAuthenticationManagerExt) { ((ISVNAuthenticationManagerExt)authManager).acknowledgeAuthentication(accepted, kind, realm, errorMessage, authentication, accessedURL); } else { authManager.acknowledgeAuthentication(accepted, kind, realm, errorMessage, authentication); } }
/** * Creates an auth manager given a user credential - a username * and password. * * @param userName a username * @param password a password */ public BasicAuthenticationManager(String userName, String password) { setAuthentications(new SVNAuthentication[] { new SVNPasswordAuthentication(userName, password, false, null, false), new SVNSSHAuthentication(userName, password, -1, false, null, false), new SVNUserNameAuthentication(userName, false, null, false), }); }
private void clearLastValidAuth() { if (myLastValidAuth != null) { myLastValidAuth.dismissSensitiveData(); } myLastValidAuth = null; }
/** * Creates an auth manager given a user credential - a username and * an ssh private key. * * @param userName a username * @param keyFile a private key file * @param passphrase a password to the private key * @param portNumber a port number over which an ssh tunnel is established */ public BasicAuthenticationManager(String userName, File keyFile, String passphrase, int portNumber) { setAuthentications(new SVNAuthentication[] { new SVNSSHAuthentication(userName, keyFile, passphrase, portNumber, false, null, false), new SVNUserNameAuthentication(userName, false, null, false), }); }
@Override public SVNAuthentication copy() { return new SVNSSHAuthentication(getUserName(), copyOf(myPassword), myPrivateKeyFile, copyOf(myPrivateKeyValue), copyOf(myPassphrase), myAgentProxy, myPortNumber, isStorageAllowed(), getURL(), isPartial()); }
/** * Creates an auth manager given a user credential - a username * and password. * * @param userName a username * @param password a password * * @since 1.8.9 */ public static BasicAuthenticationManager newInstance(String userName, char[] password) { return newInstance(new SVNAuthentication[] { SVNPasswordAuthentication.newInstance(userName, password, false, null, false), SVNSSHAuthentication.newInstance(userName, password, -1, false, null, false), SVNUserNameAuthentication.newInstance(userName, false, null, false), }); }
public void setCredentials(SVNPasswordAuthentication credentials) { if (credentials != null) { myUserName = credentials.getUserName(); myPassword = credentials.getPassword(); } }
/** * Creates an auth manager given user credentials to use. * * @param credentials user credentials * * @since 1.8.9 */ public static BasicAuthenticationManager newInstance(SVNAuthentication[] credentials) { return new BasicAuthenticationManager(credentials); }
public void setClientAuthentication(SVNSSLAuthentication sslAuthentication) { if (sslAuthentication != null) { myClientCertFile = sslAuthentication.getCertificateFile(); myClientCertPassword = sslAuthentication.getPassword(); } else { myClientCertFile = null; myClientCertPassword = null; } myClientAuthentication = sslAuthentication; }
protected HTTPAuthentication (SVNPasswordAuthentication credentials) { if (credentials != null) { myUserName = credentials.getUserName(); myPassword = credentials.getPasswordValue(); } }
@Override public SVNAuthentication copy() { return SVNUserNameAuthentication.newInstance(getUserName(), isStorageAllowed(), getURL(), isPartial()); } }
/** * Creates an auth manager given user credentials to use. * * @param authentications user credentials */ public BasicAuthenticationManager(SVNAuthentication[] authentications) { setAuthentications(authentications); }
public boolean verifyServerHostKey(String hostname, int port, String serverHostKeyAlgorithm, byte[] serverHostKey) throws Exception { if (verifier != null) { verifier.verifyHostKey(hostname, port, serverHostKeyAlgorithm, serverHostKey); } return true; } };
/** * Creates a deep copy of this credentials object. Sensitive data (e.g. password) is copied too. * * @since 1.8.9 * @return copy of this object. */ public SVNAuthentication copy() { return new SVNAuthentication(myKind, myUserName, myIsStorageAllowed, myURL, myIsPartial); }
/** * Creates an auth manager given a user credential - a username * and password. * * @param userName a username * @param password a password */ public BasicAuthenticationManager(String userName, String password) { setAuthentications(new SVNAuthentication[] { new SVNPasswordAuthentication(userName, password, false, null, false), new SVNSSHAuthentication(userName, password, -1, false, null, false), new SVNUserNameAuthentication(userName, false, null, false), }); }
/** * Creates an auth manager given a user credential - a username and * an ssh private key. * * @param userName a username * @param keyFile a private key file * @param passphrase a password to the private key * @param portNumber a port number over which an ssh tunnel is established */ public BasicAuthenticationManager(String userName, File keyFile, String passphrase, int portNumber) { setAuthentications(new SVNAuthentication[] { new SVNSSHAuthentication(userName, keyFile, passphrase, portNumber, false), new SVNUserNameAuthentication(userName, false), }); }
protected HTTPAuthentication (SVNPasswordAuthentication credentials) { if (credentials != null) { myUserName = credentials.getUserName(); myPassword = credentials.getPassword(); } }
public void setCredentials(SVNPasswordAuthentication credentials) { if (credentials != null) { myUserName = credentials.getUserName(); myPassword = credentials.getPasswordValue(); } }
public boolean verifyServerHostKey(String hostname, int port, String serverHostKeyAlgorithm, byte[] serverHostKey) throws Exception { if (hostVerifier != null) { hostVerifier.verifyHostKey(hostname, port, serverHostKeyAlgorithm, serverHostKey); } return true; } }, connectTimeout, connectTimeout);
/** * Creates an auth manager given a user credential - a username * and password. * * @param userName a username * @param password a password */ public BasicAuthenticationManager(String userName, String password) { setAuthentications(new SVNAuthentication[] { new SVNPasswordAuthentication(userName, password, false), new SVNSSHAuthentication(userName, password, -1, false), new SVNUserNameAuthentication(userName, false), }); }