LinkedIn oauth 2.0(REST)与Apple Device上的Ionic框架 [英] LinkedIn oauth 2.0 (REST) with Ionic framework on Apple Device

查看:237
本文介绍了LinkedIn oauth 2.0(REST)与Apple Device上的Ionic框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过在我的混合应用程序上对它们进行身份验证来检索LinkedIn用户个人资料信息。

I'm trying to retrieve a LinkedIn users profile information by authenticating them on my hybrid application.

我尝试使用REST api,但我不能在LinkedIn上注册一个重定向网址,以便工作。

I have tried to use the REST api, but I can not register a redirect URL on LinkedIn in order for this to work.

来自:
https://developer.linkedin.com/documents/authentication

我用过:

https://www.linkedin.com/uas/oauth2/authorization?response_type=code
&client_id=YOUR_API_KEY
&scope=r_basicprofile%20r_emailaddress
&state=STATE
&redirect_uri=YOUR_REDIRECT_URI

...但是因为iPhone上的应用程序安装了唯一的URL,我无法在LinkedIn上将其注册为重定向URL。

... but because applications on an iPhone get's installed with a unique URL, I cannot register it on LinkedIn as a redirect URL.

我也尝试过使用javascript API,但无法动态加载页面以使按钮显示和正确解析。

I also tried using the javascript API, but can not load the page dynamically for the button to appear and parse correctly.

发件人: https://developer.linkedin.com/documents/javascript-api-教程

是否有人在Ionic或任何其他混合应用程序上找到了不同的解决方案?

Is there anyone that found a different solution to implement this on Ionic or any other Hybrid application?

提前致谢。

推荐答案

我目前正在做同样的事情并遇到类似的问题。我的方法是使用InAppBrowser用户登录LinkedIn,然后从该响应中获取authcode。然后,将authcode发送到我的节点后端,在那里我发出一个请求和我的客户机密码来获取访问令牌。

I'm currently working on the same thing and ran into similar issues. My approach is to use the InAppBrowser for the user login to LinkedIn and then grab the authcode from that response. Then, send the authcode to my node backend, where I issue a request with it and my client secret to get the access token.

以下是oAuth与phonegap的一些资源,我发现这些资源非常有用:

Here are a few resources for oAuth with phonegap that I found very useful:

在IonicFramework中使用Oauth 2.0服务

Ionic forums - OAuth Login

(会留下这个评论,但由于我的声誉而不能)

(would have left this as a comment, but can't due to my reputation)

这篇关于LinkedIn oauth 2.0(REST)与Apple Device上的Ionic框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆