public PartnerConnection authenticate(String enterpriseEnvironment,
String username,
String password)
throws ConnectionException {
PartnerConnection connection;
ConnectorConfig config = new ConnectorConfig();
config.setAuthEndpoint(enterpriseEnvironment);
config.setUsername(username);
config.setPassword(password);
try {
connection = Connector.newConnection(config);
} catch (ConnectionException e) {
Logger logger = Logger.getLogger(this.getClass());
logger.error("Unable to authenticate as '" + username + "'", e);
throw e;
}
return connection;
}
String username,
String password)
throws ConnectionException {
PartnerConnection connection;
ConnectorConfig config = new ConnectorConfig();
config.setAuthEndpoint(enterpriseEnvironment);
config.setUsername(username);
config.setPassword(password);
try {
connection = Connector.newConnection(config);
} catch (ConnectionException e) {
Logger logger = Logger.getLogger(this.getClass());
logger.error("Unable to authenticate as '" + username + "'", e);
throw e;
}
return connection;
}
No comments:
Post a Comment