ggbackup.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:ggbackup 作者: lindegroup 项目源码 文件源码
def first_auth(self, client_secrets):
        """Authenticate with Google API."""
        flow = client.flow_from_clientsecrets(
            client_secrets,
            scope=[
                'https://www.googleapis.com/auth/admin.directory.group.readonly',  # noqa
                'https://www.googleapis.com/auth/admin.directory.group.member.readonly',  # noqa
                'https://www.googleapis.com/auth/apps.groups.settings'
            ],
            redirect_uri='urn:ietf:wg:oauth:2.0:oob')

        logger.debug('Generating authorization URL.')
        auth_uri = flow.step1_get_authorize_url()
        webbrowser.open(auth_uri)

        auth_code = input('Enter the auth code: ')

        logger.debug('Generating credentials.')
        self.credentials = flow.step2_exchange(auth_code)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号