def on_authentication_required(self, reply, authenticator): """Called when a website needs authentication.""" netrc_success = False if not self.netrc_used: self.netrc_used = True netrc_success = shared.netrc_authentication( reply.url(), authenticator) if not netrc_success: abort_on = self._get_abort_signals(reply) shared.authentication_required(reply.url(), authenticator, abort_on=abort_on)
def on_authentication_required(self, reply, authenticator): """Called when a website needs authentication.""" url = reply.url() log.network.debug("Authentication requested for {}, netrc_used {}" .format(url.toDisplayString(), self.netrc_used)) netrc_success = False if not self.netrc_used: self.netrc_used = True netrc_success = shared.netrc_authentication(url, authenticator) if not netrc_success: log.network.debug("Asking for credentials") abort_on = self._get_abort_signals(reply) shared.authentication_required(url, authenticator, abort_on=abort_on)
def on_authentication_required(self, reply, authenticator): """Called when a website needs authentication.""" url = reply.url() log.network.debug("Authentication requested for {}, netrc_used {}" .format(url.toDisplayString(), self.netrc_used)) netrc_success = False if not self.netrc_used: self.netrc_used = True netrc_success = shared.netrc_authentication(url, authenticator) if not netrc_success: log.network.debug("Asking for credentials") abort_on = self._get_abort_signals(reply) shared.authentication_required(url, authenticator, abort_on=abort_on)
def _on_authentication_required(self, url, authenticator): netrc_success = False if not self.data.netrc_used: self.data.netrc_used = True netrc_success = shared.netrc_authentication(url, authenticator) if not netrc_success: abort_on = [self.shutting_down, self.load_started] answer = shared.authentication_required(url, authenticator, abort_on) if not netrc_success and answer is None: try: # pylint: disable=no-member, useless-suppression sip.assign(authenticator, QAuthenticator()) # pylint: enable=no-member, useless-suppression except AttributeError: # WORKAROUND for # https://www.riverbankcomputing.com/pipermail/pyqt/2016-December/038400.html self._show_error_page(url, "Authentication required")
def _on_authentication_required(self, url, authenticator): netrc_success = False if not self.data.netrc_used: self.data.netrc_used = True netrc_success = shared.netrc_authentication(url, authenticator) if not netrc_success: abort_on = [self.shutting_down, self.load_started] answer = shared.authentication_required(url, authenticator, abort_on) if not netrc_success and answer is None: try: # pylint: disable=no-member, useless-suppression sip.assign(authenticator, QAuthenticator()) # pylint: enable=no-member, useless-suppression except AttributeError: # WORKAROUND for # https://www.riverbankcomputing.com/pipermail/pyqt/2016-December/038400.html self._show_error_page(url, "Authentication required")
def _on_authentication_required(self, url, authenticator): netrc_success = False if not self.data.netrc_used: self.data.netrc_used = True netrc_success = shared.netrc_authentication(url, authenticator) if not netrc_success: abort_on = [self.shutting_down, self.load_started] answer = shared.authentication_required(url, authenticator, abort_on) if not netrc_success and answer is None: try: # pylint: disable=no-member, useless-suppression sip.assign(authenticator, QAuthenticator()) # pylint: enable=no-member, useless-suppression except AttributeError: # WORKAROUND for # https://www.riverbankcomputing.com/pipermail/pyqt/2016-December/038400.html url_string = url.toDisplayString() error_page = jinja.render( 'error.html', title="Error loading page: {}".format(url_string), url=url_string, error="Authentication required") self.set_html(error_page)