使用LinkedIn的iOS 9 SDK通过webview而不是LinkedIn的移动应用进行身份验证 [英] Using LinkedIn's iOS 9 SDK for authentication with a webview instead of LinkedIn's mobile app

查看:152
本文介绍了使用LinkedIn的iOS 9 SDK通过webview而不是LinkedIn的移动应用进行身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的iOS应用程序目前为用户提供登录和注册LinkedIn帐户的选项。我正在将此项目用于LinkedIn日志和OAuth: LinkedInOAuth

My iOS app currently offers users the option to log in and sign up with their LinkedIn accounts. I am using this project for the LinkedIn log and OAuth: LinkedInOAuth

随着iOS 9的更新,当用户尝试使用该项目通过LinkedIn登录时,我的应用程序现在偶尔崩溃,运行时除外 WebThread(18):EXC_BAD_ACCESS( code = 1,address = 0x8)

With the update to iOS 9, my app now occasionally crashes, when a user attempts to log in through LinkedIn using that project, with a runtime exception of WebThread(18): EXC_BAD_ACCESS(code=1, address=0x8)

为了解决这种偶然的崩溃,我转向项目我正在使用它符合ios 9和linkedin的ios 9 SDK。

To resolve this occasional crash, I turned to an updated version of the project I was using that conforms to ios 9 and linkedin's ios 9 SDK.

问题在于,虽然这个新项目解决了WebThread崩溃问题,但它现在要求用户下载LinkedIn的应用程序(如果他们没有它)以便记录在我的应用程序与LinkedIn。

The issue is that while this new project has solved the WebThread crashing, it now requires users to download LinkedIn's app (if they don't have it) in order to log in to my app with LinkedIn.

上一个项目从未有过这样的要求,并且会出现一个允许任何拥有linkedin帐号的人登录的网页视图。

The previous project never had such requirements and would present a webview that allowed anyone with a linkedin account to log in.

我的问题是,我想知道是否可以在ios 9中使用LinkedIn进行身份验证,而无需用户下载移动应用程序?我希望能够在简单地呈现webvew的同时更新旧项目以符合ios 9。谢谢!

My question is am I wondering if it is possible to authenticate with LinkedIn in ios 9 without requiring the user to download the mobile app? My hopes are that it is possible to update the old project to conform to ios 9 while simply presenting a webvew. Thank you!

推荐答案

上周我们只讨论了这个问题(当时你的问题没有答案,但很高兴现在更新你 - 也就是说,如果你在此期间没有解决这个问题)。

We only discussed this last week (at the time your question didn't have an answer, but happy to update you now—that is, if you haven't solved this in the meantime).

在搜索了几个来源后,我发现了这个:

After scouring several sources I came across this:


移动vs服务器端访问令牌

目前,没有可用于交换它们的机制。如果
需要可在移动和服务器端
环境中使用的令牌,则需要在iOS环境中实施传统的OAuth 2.0
解决方案以获取可能的令牌
在两种情况下都有杠杆作用。

Presently, there is no mechanism available to exchange them. If you require tokens that can be used in both the mobile and server-side environment, you will need to implement a traditional OAuth 2.0 solution within your iOS environment to acquire tokens that can be leveraged in both situations.

来自: https://developer.linkedin.com/docs/ios-sdk-auth

前提是通过移动解决方案,他们通过他们的应用程序提供单点登录。这有效,但需要他们的应用程序。苹果公司的审批程序已经在这方面采取了两种方式,而且似乎是硬币是否允许这样做(第三方应用程序的要求)。 @ AroundThen 没有任何运气,他的应用程序因要求被拒绝,但是,其他用户*表示Apple在他们的申请过程中没有对它不利。

The premise being that via mobile solutions, they offer single sign-on thru their app. This works, but requires their app. Apple's approval process has swung both ways on this, and it appears that it is a flip of the coin as to whether they will allow this or not (the requirement of a third party app). @AroundThen didn't have any luck and his app was rejected due to the requirement, however, other users* have indicated Apple weren't adverse to it in their application processes.

或者,他们是使用OAuth2的网络登录过程。这是非移动解决方案的绝佳选择。目前,在移动和Web解决方案之间共享令牌不是默认设置,如果您想共享相同的令牌,他们的解决方案就是上面列出的解决方案。

Alternatively, their is the web logon process using OAuth2. This is pretty stock for their non-mobile solutions. Currently sharing the tokens between mobile and web solutions is not a default and if you want to share the same token their solution is that that is listed above.

本质上(并从我的其他答案中复制此处) :

In essence (and copied from my other answer here):


您可以测试链接应用程序是否存在:

You can test for the presence of the linked-in app:


  • 如果不存在:直接通过您的应用实施OAuth2

  • 如果存在:使用它或您的OAuth2实施(您可能会犯错误)使用他们的应用程序的一面,你可能需要在你的应用程序的任何功能之间的链接能力)。

从而避免要求安装应用程序,但如果是,则使用它。

Thereby avoiding the REQUIREMENT to have the app installed, but utilising it if it is.

这表明支持远离应用程序的身份验证。

This suggests that authentication away from the app is supported.

据报道,@ AroundThen已经成功通过这个过程

Reportedly, @AroundThen has had success with this process.

祝你好运!

* 1我目前无法找到他的帖子,但基本上他提供了登录Apple试图使用的凭证,但有地方问题,因此无法进入,但据推断,如果他们有,可能已批准它。

*1 I'm currently having trouble finding his post, but basically he provided login credentials that Apple attempted to use, but had locality issues and hence couldn't get in, but it was inferred they may have approved it if they had of.

这篇关于使用LinkedIn的iOS 9 SDK通过webview而不是LinkedIn的移动应用进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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