Using LinkedIn's iOS 9 SDK for authentication with a webview instead of LinkedIn's mobile app

后端 未结 1 1663
我在风中等你
我在风中等你 2021-01-24 16:07

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

Wi

1条回答
  •  清酒与你
    2021-01-24 17:10

    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:

    Mobile vs server-side access tokens

    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.

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

    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.

    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:

    • if it is not there: implement OAuth2 directly through your app
    • if it is there: use it or your OAuth2 implementation (which you'd probably err on the side of using their app for the link-ability between any features of the app you may need in yours).

    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.

    Reportedly, @AroundThen has had success with this process.

    Good luck!

    *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.

    0 讨论(0)
提交回复
热议问题