我已经尝试了很长一段时间了。我能够获取请求令牌没有问题。但是,当我试图换取访问令牌我收到以下错误:如何使用Grails oauth插件获取访问令牌?
2011-07-17 22:19:19,649 [http-8080-1] ERROR oauth.OauthService - Unable to fetch access token! (consumerName=google, requestToken=[key:4/Azm6wQDW85iYVmeb4ogCAl70D_89, secret:Zrh9saEDJcgCo83QejOu28sU, authUrl:https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token=4%2FAzm6wQDW85iYVmeb4ogCAl70D_89, isOAuth10a:true]) oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: Service provider responded in error: 400 (Bad Request
这里是在控制器代码:
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)
我一直在玩有关使用它,但它似乎从来没有以任何方式工作,我做到了。有没有人有任何想法?