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


Python IdentityProvider.LINE属性代码示例

本文整理汇总了Python中akad.ttypes.IdentityProvider.LINE属性的典型用法代码示例。如果您正苦于以下问题:Python IdentityProvider.LINE属性的具体用法?Python IdentityProvider.LINE怎么用?Python IdentityProvider.LINE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在akad.ttypes.IdentityProvider的用法示例。


在下文中一共展示了IdentityProvider.LINE属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: loginWithQrCode

# 需要导入模块: from akad.ttypes import IdentityProvider [as 别名]
# 或者: from akad.ttypes.IdentityProvider import LINE [as 别名]
def loginWithQrCode(self, keepLoggedIn=True, systemName=None, appName=None, showQr=True):
        if systemName is None:
            systemName=self.server.SYSTEM_NAME
        if appName is None:
            appName=self.server.APP_NAME
        self.server.setHeaders('X-Line-Application', appName)

        self.tauth = Session(self.server.LINE_HOST_DOMAIN, self.server.Headers, self.server.LINE_AUTH_QUERY_PATH).Talk(isopen=False)
        qrCode = self.tauth.getAuthQrcode(keepLoggedIn, systemName)

        self.callback.QrUrl('line://au/q/' + qrCode.verifier, showQr)
        self.server.setHeaders('X-Line-Access', qrCode.verifier)

        getAccessKey = self.server.getJson(self.server.parseUrl(self.server.LINE_CERTIFICATE_PATH), allowHeader=True)
        
        self.auth = Session(self.server.LINE_HOST_DOMAIN, self.server.Headers, self.server.LINE_LOGIN_QUERY_PATH).Auth(isopen=False)
        
        try:
            lReq = self.__loginRequest('1', {
                'keepLoggedIn': keepLoggedIn,
                'systemName': systemName,
                'identityProvider': IdentityProvider.LINE,
                'verifier': getAccessKey['result']['verifier'],
                'accessLocation': self.server.IP_ADDR,
                'e2eeVersion': 0
            })
            result = self.auth.loginZ(lReq)
        except:
            raise Exception('Login failed')

        if result.type == LoginResultType.SUCCESS:
            if result.authToken is not None:
                self.loginWithAuthToken(result.authToken, appName)
            else:
                return False
        else:
            raise Exception('Login failed') 
开发者ID:arifistifik,项目名称:dpk,代码行数:39,代码来源:auth.py

示例2: qrLogin

# 需要导入模块: from akad.ttypes import IdentityProvider [as 别名]
# 或者: from akad.ttypes.IdentityProvider import LINE [as 别名]
def qrLogin(self, keepLoggedIn=True, systemName=None, appName=None, showQr=False):
        if systemName is None:
            systemName=self.server.SYSTEM_NAME
        if appName is None:
            appName=self.server.APP_NAME
        self.server.setHeaders('X-Line-Application', appName)

        self.tauth = Session(self.server.LINE_HOST_DOMAIN, self.server.Headers, self.server.LINE_AUTH_QUERY_PATH).Talk(isopen=False)
        qrCode = self.tauth.getAuthQrcode(keepLoggedIn, systemName)

        self.callback.QrUrl("line://au/q/" + qrCode.verifier, showQr)
        self.server.setHeaders('X-Line-Access', qrCode.verifier)

        getAccessKey = self.server.getJson(self.server.parseUrl(self.server.LINE_CERTIFICATE_PATH), allowHeader=True)
        
        self.auth = Session(self.server.LINE_HOST_DOMAIN, self.server.Headers, self.server.LINE_LOGIN_QUERY_PATH).Auth(isopen=False)
        
        try:
            lReq = self.loginRequest('1', {
                'keepLoggedIn': keepLoggedIn,
                'systemName': systemName,
                'identityProvider': IdentityProvider.LINE,
                'verifier': getAccessKey['result']['verifier'],
                'accessLocation': self.server.IP_ADDR,
                'e2eeVersion': 0
            })
            result = self.auth.loginZ(lReq)
        except:
            raise Exception("Login failed")

        if result.type == LoginResultType.SUCCESS:
            if result.authToken is not None:
                self.tokenLogin(result.authToken, appName)
            else:
                return False
        else:
            raise Exception("Login failed") 
开发者ID:Aditmadzs,项目名称:Protect4,代码行数:39,代码来源:auth.py

示例3: loginWithQrCode

# 需要导入模块: from akad.ttypes import IdentityProvider [as 别名]
# 或者: from akad.ttypes.IdentityProvider import LINE [as 别名]
def loginWithQrCode(self, keepLoggedIn=True, systemName=None, appName=None, showQr=False):
        if systemName is None:
            systemName=self.server.SYSTEM_NAME
        if appName is None:
            appName=self.server.APP_NAME
        self.server.setHeaders('X-Line-Application', appName)
        self.tauth = Session(self.server.LINE_HOST_DOMAIN, self.server.Headers, self.server.LINE_AUTH_QUERY_PATH).Talk(isopen=False)
        qrCode = self.tauth.getAuthQrcode(keepLoggedIn, systemName)
        self.callback.QrUrl('line://au/q/' + qrCode.verifier, showQr)
        self.server.setHeaders('X-Line-Access', qrCode.verifier)
        getAccessKey = self.server.getJson(self.server.parseUrl(self.server.LINE_CERTIFICATE_PATH), allowHeader=True)
        self.auth = Session(self.server.LINE_HOST_DOMAIN, self.server.Headers, self.server.LINE_LOGIN_QUERY_PATH).Auth(isopen=False)
        try:
            lReq = self.__loginRequest('1', {
                'keepLoggedIn': keepLoggedIn,
                'systemName': systemName,
                'identityProvider': IdentityProvider.LINE,
                'verifier': getAccessKey['result']['verifier'],
                'accessLocation': self.server.IP_ADDR,
                'e2eeVersion': 0
            })
            result = self.auth.loginZ(lReq)
        except:
            raise Exception('Login failed')

        if result.type == LoginResultType.SUCCESS:
            if result.authToken is not None:
                self.loginWithAuthToken(result.authToken, appName)
            else:
                return False
        else:
            raise Exception('Login failed') 
开发者ID:prankbots,项目名称:final,代码行数:34,代码来源:auth.py

示例4: loginWithQrCode

# 需要导入模块: from akad.ttypes import IdentityProvider [as 别名]
# 或者: from akad.ttypes.IdentityProvider import LINE [as 别名]
def loginWithQrCode(self, keepLoggedIn=True, systemName=None, appName=None, showQr=False):
        if systemName is None:
            systemName=self.server.SYSTEM_NAME
        if appName is None:
            appName=self.server.APP_NAME
        self.server.setHeaders('X-Line-Application', appName)

        self.tauth = Session(self.server.LINE_HOST_DOMAIN, self.server.Headers, self.server.LINE_AUTH_QUERY_PATH).Talk(isopen=False)
        qrCode = self.tauth.getAuthQrcode(keepLoggedIn, systemName)

        self.callback.QrUrl('line://au/q/' + qrCode.verifier, showQr)
        self.server.setHeaders('X-Line-Access', qrCode.verifier)

        getAccessKey = self.server.getJson(self.server.parseUrl(self.server.LINE_CERTIFICATE_PATH), allowHeader=True)
        
        self.auth = Session(self.server.LINE_HOST_DOMAIN, self.server.Headers, self.server.LINE_LOGIN_QUERY_PATH).Auth(isopen=False)
        
        try:
            lReq = self.__loginRequest('1', {
                'keepLoggedIn': keepLoggedIn,
                'systemName': systemName,
                'identityProvider': IdentityProvider.LINE,
                'verifier': getAccessKey['result']['verifier'],
                'accessLocation': self.server.IP_ADDR,
                'e2eeVersion': 0
            })
            result = self.auth.loginZ(lReq)
        except:
            raise Exception('Login failed')

        if result.type == LoginResultType.SUCCESS:
            if result.authToken is not None:
                self.loginWithAuthToken(result.authToken, appName)
            else:
                return False
        else:
            raise Exception('Login failed') 
开发者ID:fadhiilrachman,项目名称:line-py,代码行数:39,代码来源:auth.py

示例5: loginWithQrCode

# 需要导入模块: from akad.ttypes import IdentityProvider [as 别名]
# 或者: from akad.ttypes.IdentityProvider import LINE [as 别名]
def loginWithQrCode(self):
        if self.systemName is None:
            self.systemName=self.server.SYSTEM_NAME
        if self.appName is None:
            self.appName=self.server.APP_NAME
        self.server.setHeaders('X-Line-Application', self.appName)

        self.tauth = Session(self.server.LINE_HOST_DOMAIN, self.server.Headers, self.server.LINE_AUTH_QUERY_PATH).Talk(isopen=False)
        qrCode = self.tauth.getAuthQrcode(self.keepLoggedIn, self.systemName)

        if self.e2ee:
            params = self._e2ee.generateParams()
            self.callback.QrUrl('https://line.me/R/au/q/%s?%s' % (qrCode.verifier, params), self.showQr)
        else:
            self.callback.QrUrl('https://line.me/R/au/q/' + qrCode.verifier, self.showQr)
        self.server.setHeaders('X-Line-Access', qrCode.verifier)

        getAccessKey = self.server.getJson(self.server.parseUrl(self.server.LINE_CERTIFICATE_PATH), allowHeader=True)
        if self.e2ee:
            public_key = getAccessKey['result']['metadata']['publicKey']
            encrypted_keychain = getAccessKey['result']['metadata']['encryptedKeyChain']
            hash_keychain = getAccessKey['result']['metadata']['hashKeyChain']
            keychain_data = self._e2ee.decryptKeychain(encrypted_keychain, public_key)
            print ('Public Key :', public_key)
            print ('Encrypted Keychain :', encrypted_keychain)
            print ('Hash Keychain :', hash_keychain)
            print ('Keychain Data :', keychain_data)

        self.auth = Session(self.server.LINE_HOST_DOMAIN, self.server.Headers, self.server.LINE_LOGIN_QUERY_PATH).Auth(isopen=False)

        try:
            lReq = self.__loginRequest('1', {
                'keepLoggedIn': self.keepLoggedIn,
                'systemName': self.systemName,
                'identityProvider': IdentityProvider.LINE,
                'verifier': getAccessKey['result']['verifier'],
                'accessLocation': self.server.IP_ADDR,
                'e2eeVersion': 1 if self.e2ee else 0
            })
            result = self.auth.loginZ(lReq)
        except:
            raise Exception('Login failed')

        if result.type == LoginResultType.SUCCESS:
            if result.authToken is not None:
                self.loginWithAuthToken(result.authToken)
            else:
                return False
        else:
            raise Exception('Login failed') 
开发者ID:crash-override404,项目名称:linepy-modified,代码行数:52,代码来源:auth.py


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