本文整理汇总了Python中authentication.Authentication.authenticate_user方法的典型用法代码示例。如果您正苦于以下问题:Python Authentication.authenticate_user方法的具体用法?Python Authentication.authenticate_user怎么用?Python Authentication.authenticate_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类authentication.Authentication
的用法示例。
在下文中一共展示了Authentication.authenticate_user方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: authenticate_user
# 需要导入模块: from authentication import Authentication [as 别名]
# 或者: from authentication.Authentication import authenticate_user [as 别名]
def authenticate_user(self):
global AUTHENTICATED
# we should check to see if we are already authenticated before blindly doing it again
if (AUTHENTICATED == False ):
obj = Authentication(self._vipr_info['hostname'], int(self._vipr_info['port']))
cookiedir = '/tmp/vipr_cookie_dir'
cookiefile = 'cookie-' + self._vipr_info['username'] + '-' + str(os.getpid())
obj.authenticate_user(self._vipr_info['username'], self._vipr_info['password'], cookiedir, cookiefile)
AUTHENTICATED = True