2011-07-17 13 views
2

私はかなり長い間これを試してきました。リクエストトークンを問題なくフェッチできます。私は、アクセストークンのためにそれを交換しようとすると、しかし、私は次のエラーを取得する:ここで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) 

私はそれでおよそ演奏されているが、それはそうありません私はそれをやり方で働かせる。誰にもアイデアはありますか?

答えて

2

OAuth plugin docsを見ると、一部のGoogle APIでscope属性をOAuth設定(Config.groovy)に設定する必要があることが記載されています。 Googleサーバーが400 Bad Requestを返すと考えれば、二重チェックの価値があるかもしれません。

さらに、grails.app.service.org.grails.plugins.oauthおよびgrails.app.controller.org.grails.plugins.oauthパッケージのデバッグログを有効にすると、さらにいくつかの手がかりが得られる可能性があります。

関連する問題