如何使用Google Oauth为BiqQuery授权已安装的应用程序?

如何使用Google Oauth为BiqQuery授权已安装的应用程序?,oauth,google-oauth,google-bigquery,google-cloud-platform,Oauth,Google Oauth,Google Bigquery,Google Cloud Platform,我遵循了这里的所有说明: 但一直无法使自动化过程正常运行。即使我指定urn:ietf:wg:oauth:2.0:oob作为回调,生成的URL也会尝试本地主机。当我运行我的脚本时,我会得到以下输出,网页会打开,但我从未被提示输入代码。我做错了什么?我使用的是API快速入门页面底部的完整示例代码 % python bqexample.py WARNING:root:This function, oauth2client.tools.run(), and the use of the gflags

我遵循了这里的所有说明:

但一直无法使自动化过程正常运行。即使我指定urn:ietf:wg:oauth:2.0:oob作为回调,生成的URL也会尝试本地主机。当我运行我的脚本时,我会得到以下输出,网页会打开,但我从未被提示输入代码。我做错了什么?我使用的是API快速入门页面底部的完整示例代码

 % python bqexample.py
WARNING:root:This function, oauth2client.tools.run(), and the use of the gflags library are deprecated and will be removed in a future version of the library.
Your browser has been opened to visit:

    https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fbigquery&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2F&response_type=code&client_id=(REMOVED).apps.googleusercontent.com&access_type=offline

If your browser is on a different machine then exit and re-run
this application with the command-line parameter

  --noauth_local_webserver

看起来oauth2client更改为使用argparse而不是gflags(即更改了注册标志的机制)。尝试更改当前显示的代码

credentials = run(flow, STORAGE)

那么,你应该能跑了

python bqexample.py --noauth_local_webserver

它将为您提供一个可剪切和粘贴的URL,而不是试图启动Web服务器来自动执行此过程。

谢谢!这很有效,看起来他们的教程需要更新。是的。。。文件错误存档。我还在oauth2client问题跟踪程序中插话,抱怨新的做事方式要复杂得多。
python bqexample.py --noauth_local_webserver