本文整理汇总了Python中linotp.lib.tokenclass.TokenClass.checkPin方法的典型用法代码示例。如果您正苦于以下问题:Python TokenClass.checkPin方法的具体用法?Python TokenClass.checkPin怎么用?Python TokenClass.checkPin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类linotp.lib.tokenclass.TokenClass
的用法示例。
在下文中一共展示了TokenClass.checkPin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: authenticate
# 需要导入模块: from linotp.lib.tokenclass import TokenClass [as 别名]
# 或者: from linotp.lib.tokenclass.TokenClass import checkPin [as 别名]
def authenticate(self, passw, user, options=None):
"""
do the authentication on base of password / otp and user and
options, the request parameters.
Here we contact the other LinOTP server to validate the OtpVal.
:param passw: the password / otp
:param user: the requesting user
:param options: the additional request parameters
:return: tupple of (success, otp_count - 0 or -1, reply)
"""
log.debug("authenticate")
res = False
otp_counter = -1
reply = None
otpval = passw
## should we check the pin localy??
if self.check_pin_local():
(res, pin, otpval) = split_pin_otp(self, passw, user,
options=options)
res = TokenClass.checkPin(self, pin)
if res is False:
return (res, otp_counter, reply)
(res, otp_count, reply) = self.do_request(otpval, user=user)
return (res, otp_count, reply)
示例2: checkPin
# 需要导入模块: from linotp.lib.tokenclass import TokenClass [as 别名]
# 或者: from linotp.lib.tokenclass.TokenClass import checkPin [as 别名]
def checkPin(self, pin, options=None):
"""
check the pin - either remote or localy
- in case of remote, we return true, as the
the splitPinPass will put the passw then in the otpVal
"""
res = True
# only, if pin should be checked localy
if self.check_pin_local():
res = TokenClass.checkPin(self, pin)
return res