我想通过LinkedIn登录我的应用程序。这可以通过调用Cloud.SocialIntegrations.externalAccountLogin()来完成。
但是,上述功能需要一个令牌'参数。 '令牌'由LinkedIn提供oauth流程(检索授权代码,交换请求令牌的授权代码)。
钛有一种简单的方法来获得这个标记吗?我调查了aaronksaunders的(https://github.com/aaronksaunders/clearlyinnovative.linkedIn)代码,并在gitt.io上搜索过。或者我们是否需要自己编写所有这些样板代码?
注意:目前,我不想通过服务器代理呼叫(我不想设置SSL证书等),而且我没有appcelerator团队或企业计划,所以我不能使用他们的节点(箭头)后端代理这些电话。
其他问题:配置iOS捆绑标识符(在LinkedIn应用设置页面上)是否足够?我是否需要使用此iOS设置'应用程序ID(也在LinkedIn应用程序设置页面上)?
答案 0 :(得分:1)
我已成功完成了我的流程。 Ramkumar M的这篇博文中解释了一切:http://shareourideas.com/2012/12/18/linkedin-connect-for-appcelerator-titanium/。通过使用social.js库的修改的commonjs模块版本来实现结果:https://gist.github.com/rampicos/4320296
这个库有一个非常干净的api,整个流程只不过是:
var social = require('social');
var linkedin = social.create({
consumerSecret : CONSUMER_SECRET,
consumerKey : CONSUMER_KEY,
site: 'linkedin'
});
linkedin.authorize(function(){
//callback
});
我不使用
Cloud.SocialIntegrations.externalAccountLogin()
因为登录是由social.js库完成的。
LinkedIn应用:我只配置了iOS套件标识符。