}
private Object authenticate(ClientConnection connection, Credentials credentials, ClientPrincipal principal,
boolean reAuth, boolean firstConnection) throws IOException {
final SerializationService ss = getSerializationService();
AuthenticationRequest auth = new AuthenticationRequest(credentials, principal);
connection.init();
auth.setReAuth(reAuth);
auth.setFirstConnection(firstConnection);
SerializableCollection collectionWrapper; //contains remoteAddress and principal
try {
collectionWrapper = (SerializableCollection) sendAndReceive(auth, connection);
} catch (Exception e) {
throw new RetryableIOException(e);