def incoming(self, info, environ, start_response, relay_state): """ An Authentication request has been requested, this is the second step in the sequence :param info: Information about the authentication request :param environ: WSGI environment :param start_response: WSGI start_response :param relay_state: :return: response """ # If I know which IdP to authenticate at return a redirect to it. inst = SamlSP(environ, start_response, self.config["SP"], self.cache, self.outgoing, **self.sp_args) if self.entity_id: state_key = inst.store_state(info["authn_req"], relay_state, info["req_args"]) return inst.authn_request(self.entity_id, state_key) else: # Start the process by finding out which IdP to authenticate at. return inst.disco_query(info["authn_req"], relay_state, info["req_args"])