def generate_request_header(self, response):
        host = urlparse(response.url).hostname

        try:
            result, self.context[host] = kerberos.authGSSClientInit(
                "{0}@{1}".format(self.service, host))
        except kerberos.GSSError:
            log.exception("generate_request_header(): authGSSClientInit() failed:")
            return None

        if result < 1:
            log.error("generate_request_header(): authGSSClientInit() failed: "
                      "{0}".format(result))
            return None

        try:
            result = kerberos.authGSSClientStep(self.context[host],
                                                _negotiate_value(response))
        except kerberos.GSSError:
            log.exception("generate_request_header(): authGSSClientStep() failed:")
            return None

        if result < 0:
            log.error("generate_request_header(): authGSSClientStep() failed: "
                      "{0}".format(result))
            return None

        try:
            gss_response = kerberos.authGSSClientResponse(self.context[host])
        except kerberos.GSSError:
            log.exception("generate_request_header(): authGSSClientResponse() "
                      "failed:")
            return None

        return "Negotiate {0}".format(gss_response)
Generates the GSSAPI authentication token with kerberos.
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/requests-kerberos-0.6.1/requests_kerberos/kerberos_.py/HTTPKerberosAuth.generate_request_header