当前位置: 首页>>代码示例>>Python>>正文


Python TokenClass.checkPin方法代码示例

本文整理汇总了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)
开发者ID:ae-m,项目名称:LinOTP,代码行数:36,代码来源:remotetoken.py

示例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
开发者ID:markrey,项目名称:LinOTP,代码行数:15,代码来源:remotetoken.py


注:本文中的linotp.lib.tokenclass.TokenClass.checkPin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。