【发布时间】:2013-09-30 23:31:20
【问题描述】:
在通过社交集成对用户进行身份验证后,我正在尝试访问适用于 ACS 的 Appcelerator Titanium SDK。我正在使用以下代码,它是从ACS Kitchen Sink example application 逐行复制的,但我仍然无法让它工作。用户登录调用成功,但后续调用 PhotoCollections API 返回“404 - 验证用户失败”。
我正在使用 oauth 3 legged 身份验证,并将用户身份验证方案设置为授权服务器。我也尝试过其他 ACS API,但没有任何运气。请帮忙!我已经坚持了 2 周了。
fb.addEventListener('login', function(e) {
if (e.success) {
Cloud.SocialIntegrations.externalAccountLogin({
type : 'facebook',
token : fb.accessToken
}, function(e) {
if (e.success) {
var user = e.users[0];
Cloud.PhotoCollections.create({
name : 'Party Pictures'
}, function(e) {
if (e.success) {
var collection = e.collections[0];
alert('Success:\n' + 'id: ' + collection.id + '\n' + 'name: ' + collection.name + '\n' + 'count: ' + collection.counts.total_photos + '\n' + 'updated_at: ' + collection.updated_at);
} else {
alert('Error:\n' + ((e.error && e.message) || JSON.stringify(e)));
}
});
} else {
alert('Error: ' + ((e.error && e.message) || JSON.stringify(e)));
}
});
}
});
【问题讨论】:
-
我遇到了同样的问题,但是 KeyValue 对。我还将整合照片集,我觉得这一切都是相关的。因此,如果有人可以提供帮助,请提供帮助。
标签: javascript titanium appcelerator titanium-alloy