本文整理匯總了Python中kerberos.GSS_C_MUTUAL_FLAG屬性的典型用法代碼示例。如果您正苦於以下問題:Python kerberos.GSS_C_MUTUAL_FLAG屬性的具體用法?Python kerberos.GSS_C_MUTUAL_FLAG怎麽用?Python kerberos.GSS_C_MUTUAL_FLAG使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類kerberos
的用法示例。
在下文中一共展示了kerberos.GSS_C_MUTUAL_FLAG屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: refresh_auth
# 需要導入模塊: import kerberos [as 別名]
# 或者: from kerberos import GSS_C_MUTUAL_FLAG [as 別名]
def refresh_auth(self):
service = "HTTP@" + self.hostname
flags = kerberos.GSS_C_MUTUAL_FLAG | kerberos.GSS_C_SEQUENCE_FLAG
try:
(_, vc) = kerberos.authGSSClientInit(service, flags)
except kerberos.GSSError as e:
LOG.error(_LE("caught kerberos exception %r") % e)
raise IPAAuthError(str(e))
try:
kerberos.authGSSClientStep(vc, "")
except kerberos.GSSError as e:
LOG.error(_LE("caught kerberos exception %r") % e)
raise IPAAuthError(str(e))
self.token = kerberos.authGSSClientResponse(vc)
示例2: pre_request
# 需要導入模塊: import kerberos [as 別名]
# 或者: from kerberos import GSS_C_MUTUAL_FLAG [as 別名]
def pre_request(self, resp):
# TODO: convert errors to some common error class
import kerberos
_, context = kerberos.authGSSClientInit(
"HTTP@%s" % resp.url.host,
gssflags=kerberos.GSS_C_MUTUAL_FLAG | kerberos.GSS_C_SEQUENCE_FLAG,
)
kerberos.authGSSClientStep(context, "")
response = kerberos.authGSSClientResponse(context)
headers = {"Authorization": "Negotiate " + response}
return headers, context