我想在rails中使用this应用程序接口。
它说应该包括一个授权标头。(使用oauth2)
所以我使用google-api-ruby-client这个库,如下所示。我用this sample写了下面的代码。
@client = Google::APIClient.new
@client.authorization.client_id = CONSUMER_KEY
@client.authorization.client_secret = CONSUMER_SECRET
@client.authorization.scope = 'https://apps-apis.google.com/a/feeds/domain/'
@client.authorization.redirect_uri = "http://#{request.host}:#{request.port.to_s}
/google_app/oauth2callback"
redirect_to @client.authorization.authorization_uri.to_s但是它会导致redirect_uri_mismatch错误。
我不知道我的用法是否正确。
注意:
在使用此API之前,我已成功登录Google Openid。
发布于 2012-07-30 17:38:54
可能是OAuth 2.0 sample error when accessing Google API的副本
问题在于,javascript缺少端口号。
https://stackoverflow.com/questions/11718689
复制相似问题