code: def authenticate_user(self, response, **kwargs):
          
  
          host = urlparse(response.url).hostname
  
          try:
              auth_header = self.generate_request_header(response, host)
          except KerberosExchangeError:
              # GSS Failure, return existing response
              return response
  
          log.debug("authenticate_user(): Authorization header: {0}".format(
              auth_header))
          response.request.headers['Authorization'] = auth_header
  
          # Consume the content so we can reuse the connection for the next
          # request.
          response.content
          response.raw.release_conn()
  
          _r = response.connection.send(response.request, **kwargs)
          _r.history.append(response)
  
          log.debug("authenticate_user(): returning {0}".format(_r))
          return _r
docs: Handles user authentication with gssapi/kerberos