我已经尝试了很长时间了。我能够获取请求令牌没问题。但是,当我尝试将其交换为访问令牌时,出现以下错误:
2011-07-17 22:19:19,649 [http-8080-1] 错误 oauth.OauthService - 无法获取访问令牌!(consumerName=google, requestToken=[key:4/Azm6wQDW85iYVmeb4ogCAl70D_89, secret:Zrh9saEDJcgCo83QejOu28sU, authUrl:https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token=4%2FAzm6wQDW85iYVmeb4ogCAl70D_89,is.Outh_token=4%2FAzm6wQDW85iYVmeb4ogCAl70D_89, .OAuthCommunicationException:与服务提供者通信失败:服务提供者响应错误:400(错误请求
这是控制器中的代码:
def OauthService
if (session.oauthToken == null) {
flash.message = "The token could no be retrieved... Please try again"
redirect(uri:"/")
}
def requestToken = OauthService.fetchRequestToken('google')
def accessToken = OauthService.fetchAccessToken('google', requestToken)
我一直在玩它,但它似乎从来没有以任何方式工作。有人有什么想法吗?