我们希望用LinkedIn上的信息(如果用户选择导入此信息)更新我们的用户配置文件。但是,我们要利用这此的OAuth2授权,但accordoing到LinkedIn的网站只是Ouath 1.0a的支持为他们的REST API:https://developer.linkedin.com/apis在Play上使用LinkedIn的REST API! 2和Oauth 2
什么办法解决此问题?
我们希望用LinkedIn上的信息(如果用户选择导入此信息)更新我们的用户配置文件。但是,我们要利用这此的OAuth2授权,但accordoing到LinkedIn的网站只是Ouath 1.0a的支持为他们的REST API:https://developer.linkedin.com/apis在Play上使用LinkedIn的REST API! 2和Oauth 2
什么办法解决此问题?
由于LinkedIn正在使用他们的JavaScript API你可以潜入他们的Javascript代码,并以某种方式得到的文件,在它the OAuth 2 endpoints提供的OAuth 2访问:
l.api = "https://api.linkedin.com/v1";
l.login = "https://www.linkedin.com/uas/connect/user-signin";
l.authorize = "https://www.linkedin.com/uas/oauth2/authorize?immediate=true";
[...]
l.logout = "https://www.linkedin.com/uas/connect/logout?oauth_token={OAUTH_TOKEN}&api_key={API_KEY}&callback={CALLBACK}";
l.userspace_renew = "https://www.linkedin.com/uas/js/authuserspace?v=0.0.2000-RC1.20001-1400&api_key={API_KEY}";
对于请求的资源,可能是在终端的可以使用REST API documentation。
但是,请注意,它们可能被其terms of use禁止使用这些端点而不使用它们的JS API,并可能导致您的客户端受到制裁。您可以联系他们并要求获得许可。
我在Scala和Java中创建了一个支持OAuth/CAS/OpenID/HTTP身份验证和用户配置文件检索的Play 2.x客户端:https://github.com/leleuj/play-pac4j。
是OAuth的支持,它是基于抄写并支持LinkedIn,Facebook,微博,谷歌,雅虎,DropBox的,Github上的Windows Live,WordPress的...
谢谢!我想我们可能最终只会使用SecureSocial:https://github.com/jaliss/securesocial/ – nicohvi 2012-07-18 12:55:17