I just want to know if you think it's possible to get credentials from safari cookie to log someone directly in web view in my app.
I have a "linkedin connect" way to connect into my app.
For the moment, if you have the Linkedin application installed on your device, you could connect in one click. But if you don't have it locally, I opened a webview on linkedin to ask you if you are ok to give us access to your information to create your profile. But currently the user has to re-enter their email and password manually since they don't benefit from the browser's login data.
I would like to fill the field or connect directly the user if he was connected in safari, Do you think it's possible, if yes, what can I used to do this?
Thank you!
NO, thats not possible. Safari is different app than your app and hence web view is safari don't share anything with web view with your app until it has extension to share.bjects of UIWebView class and Safari or other browsers are different and sandboxed. You can check here (official documentation.)
What you want with Linked in is possible with Facebook -- because face book login authentication method provides way to share data between apps -- But in Linkedin there is no similar way.
As given in the answer here, Safari and UIWebview don't seem to share cookies as they are sand boxed from one another.
Related
Our user experience team does not like the consent popup every time login page is opened. Also, we are looking to customize the look of the browser window presented when OAuth is implemented using ASWebAuthenticationSession/SFAuthenticationSession.
For the reasons above, I am thinking to change the implementation and use SFSafariViewController directly for Authentication.
Although I did not find any reference for this, but I am worried if using SFSafariViewController for OAuth would give problem in Appstore submission as Apple has already provided a way for it in form of ASWebAuthenticationSession/SFAuthenticationSession? Does anyone has a view on it?
Since iOS 11 SFSafariViewController no longer shares cookies so I'm afraid that's not possible.
Hi i'm having issues with using SFSafariViewController. What i'm trying to achieve is get in app browsing experience as close as Safari browsing. So that user don't feel any difference weather he is in Safari or inside the app.
This works well with most of the famous sites. But few sites does give broken experience and i'm trying to find out reason behind this.
As Per apple It shares cookies and other website data with Safari.
For example is if there is a shopping site and if user adds a product to cart within the app; It has to reflect in safari too. But it's not the case for few of sites.
Why is this happening, is this the problem from these sites, or I am missing something?
Thanks
cheers
I want to directly open LinkedIn app (already installed) from our app. I followed the LinkedIn deep link URL scheme like:
linkedin://profile?id=35932112
The LinkedIn app opens and shows the target person. However, when it is above 3rd degree connection, it shows very limited information and asks to upgrade to premium account. But if I navigates to other persons within LinkedIn app, I can still see the full profile even above 3rd degree connection.
Did I miss anything? Is it LinkedIn policy or I have to do some more configurations?
Thank you very much in advance!
Try using the profile's public url instead, it's working well for me. The LinkedIn app will intercept it and open to the profile instead. The url is usually right under the profile picture and has the following format:
https://www.linkedin.com/in/userid
That's right, you cannot display information based on people that are not your primary connections. On newer versions of the app they restricted it even more; now it returns an error for second and third connections.
There is a way to do that but it's not that straight forward. Not sure what your logic is like and will it be helpful but it's something.
So when you login with LinkedIn you can request the public-profile-url property, it will be returned in the result as publicProfileUrl and then you can save it in your backend. This way it will be saved for all the users that has authenticated for the app. When you try to open that link it will open the LinkedIn app or Safari with that profile.
PS: Hope this helps someone, I can see you question is some time ago :)
We have an ios app that uses native Facebook login just fine.
Then we also have a website (app is basically an optimized client for it) where people can login via Facebook too. When they open our website in mobile safari, they are directed to Facebook pages to authenticate there and it works, but.. it is still far from native and users have to retype credentials they often have in ios already.
So could it be possible to to somehow launch system fb authentication for just a web page (maybe using some clever URL schema?) and get granted token back to web?
Difficult way
As described here http://aaronparecki.com/articles/2012/07/29/1/oauth2-simplified#mobile-apps you could find URL scheme to trigger the native iOS app for app authorization:
fbauth://authorize?redirect_uri=[redirect_uri]&client_id=[client_id]&response_type=token
But if you call that link it's not possible to have a redirection. You could try to hack that redirection but maybe you could not find a way out.
A secure way to solve that problem is to use a SSO token to authenticate user on your App when he logs in, and next on Safari take a redirection, with a custom url to your APP, that do as bridge to FB App via Token stored in your APP. After FB authentication you can directly redirect user back to your landing page in Safari. As said by #Lego it's an alternative way to direct authenticate that could be made by going deep to custom URL used by FB.
No, it is not yet possible to directly authenticate the user via the native Facebook App, but it's possible to authenticate the user using a custom URL scheme which opens your native iOS app which then handles the authentication flow:
The user authenticates natively with your iOS App. You then store the user login (not password) in your app (i.e. using NSUserDefaults).
Then the user opens your web page in Mobile Safari. You redirect the user via a custom url scheme to your app (i.e. using myapp://authenticate). Apple documentation on implementing custom URL schemes: click
Now, if you have an active FB session in your iOS app, you can either directly redirect the user back to your landing page in Mobile Safari, passing the access token via url get parameter or you first re-authenticate the user, displaying a login view with the user name pre-filled, which you have stored in your iOS app before (step 1) and then redirect the user to your landing page, again all depending on session state and your security needs.
For opening face book app you can use Custom URL scheme. But i am not sure if u can authenticate user from it. In case if you could also then it will be confined up to the fb account which is already configured on that device app .so better try to use face book api or something
I don't get your question exactly but i think as per your question you want to create fb app Login in safari or in your custom web view.
is this perfect ?
as per my knowledge web view is different thing and native app is different thing.
if you are Login in web view then no need to check anything token or other thing because it will give you Logout thing there.
but if you are Login in your application then "developer.facebook.com" will definitely help you.
and yes, you will do most of the thing in your app as native facebook app do.
Hope it help....
I was going through Facebook's authentication mechanism.
and understood the client side, server side and desktop app processes.
But I couldn't understand the iOS tutorial.
https://developers.facebook.com/docs/mobile/ios/build/
Where it talks about How Facebook SDK for iOS gracefully falls back to diff ways of authentication depending upon whats installed on users phone.
From the tutorial I understood that,
The API checks if facebook app is installed or not and if its
there..it opens it and entire login process n pemission giving is
done there and then the app redirects back to our app passing the
authorization token, expiration, and any other parameters the
Facebook OAuth server may return.
If FB app is not installed, Safari is opened and process happens
there and access token is taken out of its cookies once it redirects
back to the app.
And if iOS doesnt support multitasking, we cant open safari or any
other app along with it,then it opens a UIWebView and carry on and
access the token from its urlbar's fragment area after #.
I got the third way which is what we do with a desktop app in .NET or air.
Can anyone explain the first n second ways ?
How can one app redirect the control to the other and how it can pass data to it.
and regarding the second way, how can the app read Safari's cookies ?
It does it by opening a URL using UIApplication – openURL: and that URL will check if the facebook app is installed by using their custom URL ( http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html ). When that happens facebook then redirects back to your app using the same mechanism.
Read the documentation under //// private here: https://github.com/facebook/facebook-ios-sdk/blob/master/src/Facebook.m