我想通过LinkedIn登录我的应用程序。这可以通过调用Cloud.SocialIntegrations.externalAccountLogin()来完成。
但是,上面的函数需要一个“token”参数。“令牌”由LinkedIn按照oauth流程提供(检索授权码,将授权码交换为请求令牌)。
有没有一种简单的方法可以用钛合金来获得这个代币?我研究了aaronksaunders(https://github.com/aaronksaunders/clearlyinnovative.linkedIn)的代码,并在gitt.io上进行了搜索。或者我们需要自己编写所有这些样板代码?
注意:目前,我不想通过服务器代理调用(我不喜欢设置SSL证书等),而且我没有appcelerator团队或企业计划,所以我不能使用他们的节点(箭头)后端来代理这些调用。
附加问题:(在LinkedIn应用程序设置页面上)配置iOS捆绑包标识符是否足够?我需要使用这个'iOS设置‘应用程序Id(也在LinkedIn应用程序设置页面上)吗?
发布于 2016-01-07 08:14:58
我已经成功地完成了我的流程。这篇来自Ramkumar M:http://shareourideas.com/2012/12/18/linkedin-connect-for-appcelerator-titanium/的博客文章解释了一切。结果是通过使用修改后的commonjs模块版本的social.js库实现的: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包标识符。
https://stackoverflow.com/questions/34644897
复制相似问题