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


Python gpsoauth.perform_oauth方法代码示例

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


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

示例1: login

# 需要导入模块: import gpsoauth [as 别名]
# 或者: from gpsoauth import perform_oauth [as 别名]
def login(self, username, password):
        self.log.info('Google login for: {}'.format(username))
        login = perform_master_login(username, password, self.GOOGLE_LOGIN_ANDROID_ID)
        login = perform_oauth(username, login.get('Token', ''), self.GOOGLE_LOGIN_ANDROID_ID, self.GOOGLE_LOGIN_SERVICE, self.GOOGLE_LOGIN_APP,
            self.GOOGLE_LOGIN_CLIENT_SIG)
            
        self._auth_token = login.get('Auth')
        
        if self._auth_token is None:
            self.log.info('Google Login failed.')
            return False
        
        self._login = True
            
        self.log.info('Google Login successful.')
        self.log.debug('Google Session Token: %s', self._auth_token[:25])

        return True 
开发者ID:Haven-Lau,项目名称:Pokemon-Go-FB-Bot,代码行数:20,代码来源:auth_google.py

示例2: createGoogleSession

# 需要导入模块: import gpsoauth [as 别名]
# 或者: from gpsoauth import perform_oauth [as 别名]
def createGoogleSession(self, locationLookup='', session=None, noop=False):

        logging.info('Creating Google session for %s', self.username)

        r1 = perform_master_login(self.username, self.password, ANDROID_ID)
        r2 = perform_oauth(
            self.username,
            r1.get('Token', ''),
            ANDROID_ID,
            SERVICE,
            APP,
            CLIENT_SIG
        )

        self.access_token = r2.get('Auth')  # access token
        return self.createPogoSession(
            provider='google',
            locationLookup=locationLookup,
            session=session,
            noop=noop
        ) 
开发者ID:cglatot,项目名称:PokeManager,代码行数:23,代码来源:api.py

示例3: login_google

# 需要导入模块: import gpsoauth [as 别名]
# 或者: from gpsoauth import perform_oauth [as 别名]
def login_google(account):
    ANDROID_ID = '9774d56d682e549c'
    SERVICE = 'audience:server:client_id:848232511240-7so421jotr2609rmqakceuu1luuq0ptb.apps.googleusercontent.com'
    APP = 'com.nianticlabs.pokemongo'
    APP_SIG = '321187995bc7cdc2b5fc91b11a96e2baa8602c62'
    while True:
        try:
            login1 = perform_master_login(account['user'], account['pw'], ANDROID_ID)
            while login1.get('Token') is None:
                lprint('[{}] Google Login error, retrying... (step 1)'.format(account['num']))
                time.sleep(2)
                login1 = perform_master_login(account['user'], account['pw'], ANDROID_ID)

            login2 = perform_oauth(account['user'], login1.get('Token'), ANDROID_ID, SERVICE, APP, APP_SIG)
            while login2.get('Auth') is None:
                lprint('[{}] Google Login error, retrying... (step 2)'.format(account['num']))
                time.sleep(2)
                login2 = perform_oauth(account['user'], login1.get('Token', ''), ANDROID_ID, SERVICE, APP, APP_SIG)

            access_token = login2['Auth']
            account['access_expire_timestamp'] = 7200000 - 30000 + get_time() #int(login2['Expiry'])*1000
            account['access_token'] = access_token
            return
        except Exception as e:
            lprint('[{}] Unexpected google login error: {}'.format(account['num'], e))
            lprint('[{}] Retrying...'.format(account['num']))
            time.sleep(1) 
开发者ID:seikur0,项目名称:PGO-mapscan-opt,代码行数:29,代码来源:main0.py

示例4: get_access_token

# 需要导入模块: import gpsoauth [as 别名]
# 或者: from gpsoauth import perform_oauth [as 别名]
def get_access_token(self, force_refresh=False):
        token_validity = self.check_access_token()

        if token_validity is True and force_refresh is False:
            self.log.debug('Using cached Google Access Token')
            return self._access_token
        else:
            if force_refresh:
                self.log.info('Forced request of Google Access Token!')
            else:
                self.log.info('Request Google Access Token...')

            token_data = perform_oauth(None, self._refresh_token, self.GOOGLE_LOGIN_ANDROID_ID, self.GOOGLE_LOGIN_SERVICE, self.GOOGLE_LOGIN_APP,
                self.GOOGLE_LOGIN_CLIENT_SIG)

            access_token = token_data.get('Auth', None)
            if access_token is not None:
                self._access_token = access_token
                self._access_token_expiry = int(token_data.get('Expiry', 0))
                self._login = True

                self.log.info('Google Access Token successfully received.')
                self.log.debug('Google Access Token: %s...', self._access_token[:25])
                return self._access_token
            else:
                self._access_token = None
                self._login = False
                raise AuthException("Could not receive a Google Access Token") 
开发者ID:PokeHunterProject,项目名称:pogom-linux,代码行数:30,代码来源:auth_google.py

示例5: login_google

# 需要导入模块: import gpsoauth [as 别名]
# 或者: from gpsoauth import perform_oauth [as 别名]
def login_google(username, password):
    print '[!] Google login for: {}'.format(username)
    r1 = perform_master_login(username, password, ANDROID_ID)
    r2 = perform_oauth(username,
                       r1.get('Token', ''),
                       ANDROID_ID,
                       SERVICE,
                       APP,
                       CLIENT_SIG, )
    return r2.get('Auth') 
开发者ID:rubenmak,项目名称:PokemonGo-SlackBot,代码行数:12,代码来源:pokehomey.py

示例6: get_access_token

# 需要导入模块: import gpsoauth [as 别名]
# 或者: from gpsoauth import perform_oauth [as 别名]
def get_access_token(self, force_refresh = False):
        token_validity = self.check_access_token()

        if token_validity is True and force_refresh is False:
            self.log.debug('Using cached Google Access Token')
            return self._access_token
        else:
            if force_refresh:
                self.log.info('Forced request of Google Access Token!')
            else:
                self.log.info('Request Google Access Token...')

            token_data = perform_oauth(None, self._refresh_token, self.GOOGLE_LOGIN_ANDROID_ID, self.GOOGLE_LOGIN_SERVICE, self.GOOGLE_LOGIN_APP,
                self.GOOGLE_LOGIN_CLIENT_SIG)

            access_token = token_data.get('Auth', None)
            if access_token is not None:
                self._access_token = access_token
                self._access_token_expiry = int(token_data.get('Expiry', 0))
                self._login = True

                self.log.info('Google Access Token successfully received.')
                self.log.debug('Google Access Token: %s...', self._access_token[:25])
            else:
                self._access_token = None
                self._login = False
                raise AuthException("Could not receive a Google Access Token") 
开发者ID:joaoanes,项目名称:pokescan,代码行数:29,代码来源:auth_google.py

示例7: login_google

# 需要导入模块: import gpsoauth [as 别名]
# 或者: from gpsoauth import perform_oauth [as 别名]
def login_google(username, password):
    print('[!] Google login for: {}'.format(username))
    r1 = perform_master_login(username, password, ANDROID_ID)
    r2 = perform_oauth(username, r1.get('Token', ''), ANDROID_ID, SERVICE, APP,
        CLIENT_SIG)

    return r2.get('Auth') # access token 
开发者ID:joaoanes,项目名称:pokescan,代码行数:9,代码来源:main.py

示例8: get_access_token

# 需要导入模块: import gpsoauth [as 别名]
# 或者: from gpsoauth import perform_oauth [as 别名]
def get_access_token(self, username, password):
        r1 = perform_master_login(username, password, ANDROID_ID)
        r2 = perform_oauth(username, r1.get('Token', ''), ANDROID_ID, SERVICE, APP, CLIENT_SIG)
        return r2.get('Auth') 
开发者ID:mayank26saxena,项目名称:PokeBot,代码行数:6,代码来源:google.py


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