def ssh_accept_sec_context(self, hostname, username, recv_token):
        """
        Accept a SSPI context (server mode).

        :param str hostname: The servers FQDN
        :param str username: The name of the user who attempts to login
        :param str recv_token: The SSPI Token received from the server,
                               if it's not the initial call.
        :return: A ``String`` if the SSPI has returned a token or ``None`` if
                 no token was returned
        """
        self._gss_host = hostname
        self._username = username
        targ_name = "host/" + self._gss_host
        self._gss_srv_ctxt = sspi.ServerAuth("Kerberos", spn=targ_name)
        error, token = self._gss_srv_ctxt.authorize(recv_token)
        token = token[0].Buffer
        if error == 0:
            self._gss_srv_ctxt_status = True
            token = None
        return token
def ssh_accept_sec_context ( self , hostname , username , recv_token ) : self . _gss_host = hostname self . _username = username targ_name = "host/" + self . _gss_host self . _gss_srv_ctxt = sspi . ServerAuth ( "Kerberos" , spn = targ_name ) error , token = self . _gss_srv_ctxt . authorize ( recv_token ) token = token [ 0 ] . Buffer if error == 0 : self . _gss_srv_ctxt_status = True token = None return token
Accept a SSPI context (server mode).

        :param str hostname: The servers FQDN
        :param str username: The name of the user who attempts to login
        :param str recv_token: The SSPI Token received from the server,
                               if it's not the initial call.
        :return: A ``String`` if the SSPI has returned a token or ``None`` if
                 no token was returned