【问题标题】:AuthSub nextURL on GAEGAE 上的 AuthSub nextURL
【发布时间】:2011-03-04 19:38:07
【问题描述】:

我在看 http://code.google.com/intl/sv-SE/apis/gdata/docs/auth/authsub.htmlhttp://code.google.com/intl/sv-SE/appengine/articles/java/retrieving_gdata_feeds.html.

我的代码看起来像这样生成 URL

String nextUrl = "http://myapp.appspot.com/retrieveToken/";
String scope = "http://www.google.com/calendar/feeds/";
boolean secure = false;  // set secure=true to request secure AuthSub tokens
boolean session = true;
String authSubUrl = AuthSubUtil.getRequestUrl(nextUrl, scope, secure, session);

生成的url是这样的

https://www.google.com/accounts/AuthSubRequest?next=http%3A%2F%2Fmyapp.appspot.com%2FretrieveToken%2F&scope=http%3A%2F%2Fwww.google.com%2Fcalendar%2Ffeeds%2F&secure=0&session=1

看起来不错.. 但是,当我关注 URL 时,我会被告知类似于

"http://appspot.com" is not registered.

(我用瑞典语理解 :)

这里有什么问题?

【问题讨论】:

    标签: java google-app-engine authsub


    【解决方案1】:

    这很奇怪,因为您选择了secure = false,所以您不必注册应用程序(您的 URL 中有 secure=0)。但我觉得这是与*.appspot.com 域有关的问题,因为如果将nextUrl 更改为其他任何内容,比如说"http://myapp.randomDomainHjYHBB4F.com/retrieveToken/",新的URL 是:

    https://www.google.com/accounts/AuthSubRequest?next=http%3A%2F%2Fmyapp.randomDomainHjYHBB4F.com%2FretrieveToken%2F&scope=http%3A%2F%2Fwww.google.com%2Fcalendar%2Ffeeds%2F&secure=0&session=1
    

    ... 它有效!是不是很好奇?

    所以我不能告诉你出了什么问题,但有一个简单的解决方法:你可以register your applicationswitch to secure mode

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多