我已經嘗試了很長一段時間了。我能夠獲取請求令牌沒有問題。但是,當我試圖換取訪問令牌我收到以下錯誤:如何使用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)
我一直在玩有關使用它,但它似乎從來沒有以任何方式工作,我做到了。有沒有人有任何想法?