Creates a SAML response.
    :param binding: SAML response binding
    :param http_args: http arguments
    :return: response.Response
339644
def make_saml_response(binding, http_args):
    
    if binding == BINDING_HTTP_REDIRECT:
        headers = dict(http_args["headers"])
        return SeeOther(str(headers["Location"]))

    return Response(http_args["data"], headers=http_args["headers"])
808663
def callback(response = {})
      if response.empty?
        raise ArgumentError, "No callback parameters found"
      end

      CallbackResponse.new(response, config)
    end
559700
def _build_http_client(cls, session: AppSession):
        '''
        '''
        # TODO:
        # recorder = self._build_recorder()

        stream_factory = functools.partial(
            HTTPStream,
            ignore_length=session.args.ignore_length,
            keep_alive=session.args.http_keep_alive)

        return session.factory.new(
            'HTTPClient',
            connection_pool=session.factory['ConnectionPool'],
            stream_factory=stream_factory
         )
506690
public function getHttpPostBindingResponse(SamlMessage $message)
    {
        $bindingFactory = new BindingFactory();
        $postBinding = $bindingFactory->create(SamlConstants::BINDING_SAML2_HTTP_POST);

        $messageContext = new MessageContext();
        $messageContext->setMessage($message);

        $httpResponse = $postBinding->send($messageContext);

        return new HtmlResponse($httpResponse->getContent());
    }
479404
def request(self, method, url, *args):
        
        return self.http.request(method, url, *args)
771174
def create_response(version, status, headers):
    """"""
    message = []
    message.append('HTTP/{} {}\r\n'.format(version, status))
    for name, value in headers:
        message.append(name)
        message.append(': ')
        message.append(value)
        message.append('\r\n')
    message.append('\r\n')
    return s2b(''.join(message))
115637
def add_response_signature(self, response_data, sign_algorithm=OneLogin_Saml2_Constants.RSA_SHA1):
        
        return self.__build_signature(response_data, 'SAMLResponse', sign_algorithm)
18966
def _post_response(self, params):
        
        return self._session.post(
            self._api_url, data=params, timeout=self._timeout
        ).json(encoding="utf8")
866256
function(params, callback) {
                var keyId;

                if (params) {
                    if (params.keyId != 'undefined') {
                        keyId = params.keyId;
                    }
                }

                var httpRequestParams = {
                    url: SERVICE_ADDRESSES.SSO_ADDRESS + SERVICES_PATH.SSO_GET_KEY + keyId,
                    method: 'GET',
                    headers: {
                        'Authorization': 'Bearer ' + token
                    }
                };

                httpRequest(httpRequestParams, function(result) {
                    if (!result.hasError) {
                        try {
                            var response = JSON.parse(result.result.responseText);
                        }
                        catch (e) {
                            console.log(e);
                        }

                        callback && callback({
                            hasError: false,
                            secretKey: response.secretKey
                        });
                    }
                    else {
                        callback && callback({
                            hasError: true,
                            code: result.errorCode,
                            message: result.errorMessage
                        });

                        fireEvent('error', {
                            code: result.errorCode,
                            message: result.errorMessage,
                            error: result
                        });
                    }
                });
            }
833840
def create_authn_query_response(self, subject, session_index=None,
                                    requested_context=None, in_response_to=None,
                                    issuer=None, sign_response=False,
                                    status=None, sign_alg=None, digest_alg=None,
                                    **kwargs):
        

        margs = self.message_args()
        asserts = []
        for statement in self.session_db.get_authn_statements(
                subject.name_id, session_index, requested_context):
            asserts.append(saml.Assertion(authn_statement=statement,
                                          subject=subject, **margs))

        if asserts:
            args = {"assertion": asserts}
        else:
            args = {}

        return self._response(in_response_to, "", status, issuer,
                              sign_response, to_sign=[], sign_alg=sign_alg,
                              digest_alg=digest_alg, **args)
1031342
def create(cls, expr, binds):
        
        return cls(expr=expr, binds=binds, dtype=bool_dtype)
1219653
def post(self):
        
        logger.info("--- In SSO POST ---")
        saml_msg = self.unpack_either()
        self.req_info = IDP.parse_authn_request(
            saml_msg["SAMLRequest"], BINDING_HTTP_POST)
        _req = self.req_info.message
        if self.user:
            if _req.force_authn:
                saml_msg["req_info"] = self.req_info
                key = self._store_request(saml_msg)
                return self.not_authn(key, _req.requested_authn_context)
            else:
                return self.operation(saml_msg, BINDING_HTTP_POST)
        else:
            saml_msg["req_info"] = self.req_info
            key = self._store_request(saml_msg)
            return self.not_authn(key, _req.requested_authn_context)
1279567
public Response buildResponse(String samlResponse) throws MnoException {
		try {
			return Response.loadFromBase64XML(this, samlResponse);
		} catch (Exception e) {
			throw new MnoException("Could not build Response from samlResponse: " + samlResponse, e);
		}
	}
785984
def render_table_to_response(*args, **kwargs):
    
    response = render_table(*args, **kwargs)
    if isinstance(response, HttpResponse):  # pragma: no cover
        return response
    return HttpResponse(response)
15443
def __make_http_query(self, params, topkey=''):
        
        if len(params) == 0:
            return ""
        result = ""
        # is a dictionary?
        if type(params) is dict:
            for key in params.keys():
                newkey = quote(key)
                if topkey != '':
                    newkey = topkey + quote('[' + key + ']')
                if type(params[key]) is dict:
                    result += self.__make_http_query(params[key], newkey)
                elif type(params[key]) is list:
                    i = 0
                    for val in params[key]:
                        if type(val) is dict:
                            result += self.__make_http_query(
                                val, newkey + quote('['+str(i)+']'))
                        else:
                            result += newkey + \
                                quote('['+str(i)+']') + "=" + \
                                quote(str(val)) + "&"
                        i = i + 1
                # boolean should have special treatment as well
                elif type(params[key]) is bool:
                    result += newkey + "=" + \
                        quote(str(params[key]).lower()) + "&"
                # assume string (integers and floats work well)
                else:
                    result += newkey + "=" + quote(str(params[key])) + "&"
        # remove the last '&'
        if (result) and (topkey == '') and (result[-1] == '&'):
            result = result[:-1]
        return result
752514
def _http_response(self, url, method, data=None, **kwargs):
        
        header = {'content-type': 'application/json'}

        if data:
            data = json.dumps(data)
        path = url.format(**kwargs)
        logger.debug("%s %s", method.__name__.upper(), path)
        response = method(self.host + path,
                          data=data, headers=header, **self.method_kwargs)
        logger.debug("%s %s", response.status_code, response.reason)
        response.raise_for_status()

        return response
812261
def __reply(self, reply, args, kwargs):
        
        binding = self.method.binding.input
        msg = binding.get_message(self.method, args, kwargs)
        log.debug('inject (simulated) send message:\n%s', msg)
        binding = self.method.binding.output
        return self.succeeded(binding, reply)