0

我正在查看 http://code.google.com/intl/sv-SE/apis/gdata/docs/auth/authsub.htmlhttp://code.google.com/intl/sv-SE/appengine/文章/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.

(我用瑞典语得到它:)

这里有什么问题?

4

1 回答 1

1

这很奇怪,因为您选择secure = false了 ,所以您不必注册应用程序(您secure=0的 URL 中有)。但我觉得这是与*.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

......它的工作原理!是不是很好奇?

So I can't tell you what's wrong but there is an easy workaround: you can register your application and switch to secure mode!

于 2011-03-04T11:38:07.730 回答