How can I maintain user credentials (django server) in a way that bypasses the login page on an iOS app even after turning the phone off? - ios

I've been told to use Oauth2.0, but I don't understand what I am to do with it on either side.
I would specifically like to achieve the persistent login that Facebook and Twitter maintain in their respective iOS apps.
PLEASE give me a specific answer (and hopefully an example too!)
I know that this may be achieve with Oauth2.0, but I have been unable to find an example as to how (even after extensive research- if I could find the answer I wouldn't be asking the question here.)
Thank you in advance!
-John

Related

embedding Javascript in SFSafariViewController

I'm not sure if it's possible. I'm currently developing an app the stores password (like a password manager). One of its features is to allow user to make an auto login to a web browser of that device. I was able to make it work using UIWebView and WKWebView but can't find a way to make it work using SFSafariViewController. I read few documentations and blogs about it and even read the SFSafariViewController.h but there's no clue in there that can lead me to the function that I wanted. I want to know how to do a "evaluateJavaScript"-a-like function in SFSafariViewController or if its not possible, do you guys have other suggestions on how to achieve this?
Note: I'm using Objective-C.
Thanks in advance!
Happy coding!
SFSafariViewControllers are sandboxed. As they are essentially Safari, and have access to cookies. It would be a security risk to allow any app to access these.
However, if the web-service you want the user to sign in to is yours, you can setup a API and a custom URL scheme.
Follow this documentation.
If you are trying to store passwords etc from sites you don't maintain then unfortunately, this is not possible using the SFSafariViewController.
Hope this helps,
Liam

Asana User oauth authenticatication in ios apps

Hi All: I have integrated asana with my ios app using AsanaAPIKey for the user authentication. Now I want to do it using oauth authentication(new requirement).I have searched a lot but haven't found any valuable stuff related to this.Some examples are given in Ruby,but I know nothing about Ruby.Can any one help me out.
We don't have official iOS examples, but in general OAuth on Asana tries to be as close to "typical" as possible. Check out another SO question, https://stackoverflow.com/questions/5374570/whats-the-best-ios-oauth2-framework, for help with iOS and OAuth 2.0, between that and the developer docs https://asana.com/developers/documentation/getting-started/authentication I hope you find what you need, but if you run into specific issues please share them!
In the long-term we're hoping to have a proper iOS SDK to make this easier, but given constrained resources I wouldn't hold your breath on that.

accessing FBSession token from html in a UIWebView

I have an app that I want to integrate with Facebook. It is a hybrid app with a native part and a javascript part that is in a UIWebView. I would like the user to be able to be logged into "both" parts. What is the standard way of handling this? Does the facebook sdk 3.1 natively handle this? Do I need some way of passing it in the url that I instantiate it with? Can I access NSUserDefaults from javascript? Can I create a custom handler to get at it?
I googled but due to common nature of words wasn't able to find anything that addressed this. I did read that LinkedIn's hybrid app actually ran a local server for accessing user data. This is more than I want to do. Any help is appreciated and sorry if this is addressed by Facebook SDK but wasn't able to find id.
thx in advance

Post to news feed with Facebook SDK without login in

Is there a way to post on the user wall without having to do login?
Going thought the documentation i can do this but the user has to do login, which i donĀ“t want cause this is a simple app.
I know there is a tutorial in the facebook developers website, because i found it and only later i realize that. Something using "publish_stream" permissions, if someone can point me in the right direction i appreciate.
It is not automatic (which would violate Platform Policy anyway), but you can use the Feed Dialog for this:
https://developers.facebook.com/docs/reference/dialogs/feed/

iOS - Simple Facebook Authentication

I'm trying to authenticate my user on FB with my app in a simple manner, the iOS SDK has this SSO explanation and that's pretty much it, and it seems a bit extreme since I pretty much have to wrap up my entire app in FB goodness, at least that's what they guide you through.
Is there just a simple way, be it with the SDK or some other manner, to guide the user through the OAuth process and retrieve the access token and user data, like name, email and birthdate?
One shortcut here is using something like Parse to handle it for you. They actually also include a very nicely made login view controller that does exactly what you're looking for. You can see it here.

Resources