def __follow_chain(self, response): for c in self.cookiejar: if c.name.startswith('_shibsession_') and \ c.domain == urlsplit(self.url)[1]: set_cookies_expiries(self.cookiejar) self.response = response for l in self.__listeners: try: l(response) except TypeError: l() return response type, adapter = getFormAdapter(response, self.idp, self.cm) if adapter: if adapter.interactive: self.adapter = adapter self.response = response response = adapter.prompt(self) if response: return response return else: request, response = adapter.submit(self.opener, response) return self.__follow_chain(response) raise Exception("Unknown error: Shibboleth auth chain lead to nowhere")
def _formadapter(self, file_name): type, name = file_name.rsplit('_', 1) html = open(path.join(here, file_name + '.html')) rname, adapter = forms.getFormAdapter(html, None, None) self.assertEqual('_'.join([rname, name]), file_name)