How to design the facebook id login process from iphone using GAE as the background server? - iphone

I'm designing an iPhone/android app which needs user to login using his/her facebook account.
The app uses GAE (Google App Engine) as the background server, so the problem now is that I don't know how GAE, iPhone and Facebook authentication works.
My guess is user login FB from iPhone and will get an access_token, and then the iphone app sends the access_token to GAE so that GAE can recognize the user.
Is that correct? Or is there any tutorial about how to cooperate between these platforms?
Thanks!

Take a look at the LeanEngine open source project. It was designed to do exactly what you are trying to do - login from a mobile device to GAE with Facebook or OpenID account (and sync data between the client and GAE).
It consists of a preprogrammed GAE application and libraries for Android and iOS and if you are satisfied with the built-in functionality you really do not need to do any modifications to the server part. You can just use it as it is.

Related

Possible to use the native facebook app to log into a mobile html5 app? On the iPhone

I'm trying to have my html5 site open the native iPhone Facebook app to authenticate users.
The site currently uses OAuth 2 on the server side - so it redirects everyone to the web version of Facebook. This is a problem because I dont want to force people to log in on a tiny keyboard.
Can you get the html5 app to open in Safari and authenticate through the native FB app?
If this is not possible with Facebook is it possible with Twitter apps? What is the experience like on android?
I do know that you can authenticate between a native iPhone app and the native Facebook app.
Yes you can do this just use the boilerplate code in facebook developers section of the site and following the guide exactly... I have tried this and it worked for me you just need to find a way to connect your oAuth to this...

App Store can accept this flow or not

I have integrated Facebook functionality into my applications. By using the link https://github.com/facebook/facebook-ios-sdk, I have integrated the Facebook. In this application, at the time of login, it's opening Safari and at the same time the application is going to the background and then after login again it's coming back to the application. My intention is that this flow can accept the application store or not.
This is the official Facebook iOS SDK and many apps in App Store already use it. So you can use it inside your app.
Also, the flow in your question is exactly what the documentation of the library describes and is, again, used by apps that are already in App Store:
If the device is running in a version of iOS that supports multitasking, but it doesn't have the Facebook app of version 3.2.3 or greater installed, the SDK will open the authorization dialog in Safari. After the user grants or revokes the authorization, Safari redirects back to the calling app. Similar to the Facebook app based authorization, this allows multiple apps to share the same Facebook user access_token through the Safari cookie.
So, yes, there is nothing wrong with this flow.

How to validate a user request from iPhone is an authenticated Facebook user?

I'd like to build a web application which allow iPhone users to save a short memo as a todo list on the web server. The user must logon on Facebook on the iPhone before submitting a memo.
On the server side, how can I tell whether the iPhone user has logon on Facebook or not?
In a native app, FBConnect can be used to establish trust between the app and Facebook. (FBConnect calls an fbDidLogin delegate method).
It's up to you to establish trust between your iPhone app and your web service, but once you have, the app can report the FB login state along with it's requests.
Assuming you're just building a web application, I don't understand why it would be different then building a normal web application that uses fbconnect and graph api. You just happen to design it to fit a mobile browser. There's a section on authentication.

Connecting to Twitter using xAuth on iPhone and/or OAuth on Web?

I am building a Web site and iPhone app right now. My site and app requires registration.
I have received xAuth permission from Twitter and was going to use this for the iPhone app so that users can connect their Twitter account.
Once they connect their Twitter account, if they log in to the Web, is it possible to make it so their account is still connected?
On the other hand, I am using OAuth verification on the Web. If someone connects their Twitter account on the Web using OAuth, will they still be connected if logging onto the iPhone app?
So basically, I need to make:
User connects account on iPhone app (xAuth) -> User logs in to Web site and is still connected and can post to Twitter from both
User connects on Web (OAuth) -> User logs in to iPhone app and is still connected and can post to Twitter from both
You can do this --- basically once you do the OAuth based login it generate unique Token, so after this data reading is done using Token.
Once you get Token (it can be in Phone/web) use this details between each other so that both of your application can do the rest of operation for the same user without further login.

iPhone app using facebook connect login to authenticate with web server possible?

I'm developing an iPhone app that will need a login system in order for users to post content to a server. I'd really like to use facebook connect for this as it's a very community driven app. Is it possible for me to securely authenticate with the web server without the user having to create a username and password specifically for my app?
One idea I've had is using my app's FBConnect secret key as a password for an HTTPS connection? The app would be able to tell if a user is logged in, and only connect to the server if so. This would also stop any other connections from hackers etc I assume?
Although not just restricted to Facebook, Janrain provide a great solution to login from various openid methods including facebook connect. I believe there is a free product for non-commercial use. There is a demo iPhone app on the app store to show you how it works etc.
http://www.janrain.com/products/engage
Why not just use the Facebook iOS SDK?