Google app engine OAuth2WebServerFlow可以从localhost工作,但不能从真实的AppEngine实例工作

Google app engine OAuth2WebServerFlow可以从localhost工作,但不能从真实的AppEngine实例工作,google-app-engine,oauth,oauth-2.0,google-oauth,gdata,Google App Engine,Oauth,Oauth 2.0,Google Oauth,Gdata,我使用OAuth2WebServerFlow获取用户的工作表凭证,以便与gdata/spreadsheets API一起使用。我真的很难诊断这个问题,因为当我在本地运行应用程序时,它可以完美地工作 这是我用来获取授权URL的代码段: CLIENT_ID = 'my-id' CLIENT_SECRET = 'my-secret' SCOPE = 'https://spreadsheets.google.com/feeds' flow_object = OAuth2WebServerFlow(CLI

我使用OAuth2WebServerFlow获取用户的工作表凭证,以便与gdata/spreadsheets API一起使用。我真的很难诊断这个问题,因为当我在本地运行应用程序时,它可以完美地工作

这是我用来获取授权URL的代码段:

CLIENT_ID = 'my-id'
CLIENT_SECRET = 'my-secret'
SCOPE = 'https://spreadsheets.google.com/feeds'
flow_object = OAuth2WebServerFlow(CLIENT_ID, CLIENT_SECRET, SCOPE, redirect_uri=self.REDIRECT_URL, access_type='online')
authorize_url = flow_object.step1_get_authorize_url()
本地(使用
重定向http://localhost:8080/this-路径/'
) 这将产生:

https://accounts.google.com/o/oauth2/auth?redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fthis-路径%2F&scope=https%3A%2F%2fseadsheets.google.com%2feeds&client\u id=my id&response\u type=code&access\u type=online

在live App Engine应用程序上(使用
REDIRECT\u URL=)http://my-app.appspot.com/this-path/“
) 这将产生:

https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fspreadsheets.google.com%2Ffeeds&redirect_uri=http%3A%2F%2Fmy-app.appspot.com%2F此路径%2F&response\u type=code&client\u id=my id&access\u type=online

应用程序配置如下所示:

CLIENT ID: my-id
EMAIL ADDRESS: my-id@developer.gserviceaccount.com
CLIENT SECRET:  my-secret
REDIRECT URIS:
    http://localhost:8080/
    http://my-app.appspot.com
    https://my-app.appspot.com
    http://my-app.appspot.com/this-path
    https://my-app.appspot.com/this-path
    http://my-app.appspot.com/this-path/
    https://my-app.appspot.com/this-path/
JAVASCRIPT ORIGINS
    http://localhost:8080
    http://my-app.appspot.com
转到本地生成的url版本,我可以成功授予应用程序权限。但是在我的实时应用程序生成的url上,我得到一个401,上面写着“Error:disabled\u client-the OAuth client-is disabled”


我觉得这可能只是一个配置错误。也许它在本地工作只是一种转移注意力的手段?也许我总是能够授予localhost这些权限?我真的没有这个想法,任何帮助都将不胜感激。

在应用程序配置中,重定向URL应该是这样的oauth2callback,根据我的理解,oauth2callback在流程结束时授权令牌。请参阅文件[1]


[1] OAuth2.0

所以我理解正确,你是说你认为路径必须是“oauth2callback”?我可以稍后再试试看,但我对此持怀疑态度。特别是考虑到“oauth2callback”不在您用作参考的页面上。