<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def on_auth(self, f, connection, address):
 """ Checks for authentication of a connection. :param f: (:class:`~hazelcast.future.Future`), future that contains the result of authentication. :param connection: (:class:`~hazelcast.connection.Connection`), newly established connection. :param address: (:class:`~hazelcast.core.Address`), the adress of new connection. :return: Result of authentication. """

        if f.is_success():
            self.logger.info("Authenticated with %s", f.result(), extra=self._logger_extras)
            with self._new_connection_mutex:
                self.connections[connection.endpoint] = f.result()
                try:
                    self._pending_connections.pop(address)
                except KeyError:
                    pass
            for on_connection_opened, _ in self._connection_listeners:
                if on_connection_opened:
                    on_connection_opened(f.result())
            return f.result()
        else:
            self.logger.debug("Error opening %s", connection, extra=self._logger_extras)
            with self._new_connection_mutex:
                try:
                    self._pending_connections.pop(address)
                except KeyError:
                    pass
            six.reraise(f.exception().__class__, f.exception(), f.traceback())