0

Gmailでコンテンツを取得するのに助けが必要です.

私はmyappsを作成しました

       Client ID: XXXXXXXX.apps.googleusercontent.com   
       Email address:   
       765792474035@developer.gserviceaccount.com
      Client secret:    
      k2f2j0fFEdAt_EDTE0ATeQ3x
      Redirect URIs:    http://localhost/
      JavaScript origins:   http://localhost/

私のJavaScript関数

          $('.invitecontact-gmail').click(function(){

          https: accounts.google.com/o/oauth2/auth?scope=htttp://ww.google.com/m8/feeds/redirect_uri=redirect_uri=http:///&response_type=token&client_id=XXXXXXXXX.apps.googleusercontent.com;

});

このリンク ディパリー エラー: invalid_request redirect_uri:

localhost で Google アプリを開く方法 localhost に自分のアプリの redirect_url を入れてみました。同じエラーが来ていました

naybody plz は私を助けてください。

4

1 に答える 1

1

URL をGoogle Developers - Implementing OAuth 2.0 Authenticationの例と比較すると、いくつかの構文エラーとタイプミスが明らかです。受け取ったエラー メッセージはリダイレクト URI に関するものなので、まずそれを正しく理解することから始めてください。

https: accounts.google.com/o/oauth2/auth?
scope= htttp :// ww .google.com/m8/feeds/ redirect_uri=redirect_uri=http:/// & response_type=token& client_id=XXXXXXXXX.apps.googleusercontent.com;

以下は構文的に正しいでしょう (読みやすくするために空白が追加されています)。

https: accounts.google.com/o/oauth2/auth?
  scope=http://www.google.com/m8/feeds/&                << Check this URL
  redirect_uri=<SOME-VALID_URI>&                        << Placeholder
  response_type=token&
  client_id=XXXXXXXXX.apps.googleusercontent.com;

アプリケーションの有効な URI を特定し、プレースホルダーを置き換える必要があります。たとえば、redirect_uri=http://localhost/oauth2callback.

于 2013-03-25T19:25:27.670 に答える