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;

});

此链接 dipaly 错误:invalid_request redirect_uri:

如何在本地主机中打开谷歌应用程序我尝试了我的应用程序 redirect_url 放在本地主机中。同样的错误来了

任何人请帮助我。

4

1 回答 1

1

通过将您的 URL 与Google Developers - Implementing OAuth 2.0 Authentication的示例进行比较,可以发现一些语法错误和拼写错误。由于您收到的错误消息抱怨重定向 uri,因此您应该从正确开始。

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

以下在语法上是正确的(为可读性添加了空格):

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 回答