Question about subscribing to facebook from my iOS app

I am writing an iPhone application that requires a server component, and instead of having the user create a new account only for my application, I thought I would make their life easier by launching them using my facebook account, I do not plan to use the API The Facebook Connect interface is very simple, I just realized that no one wants to remember an additional password if they do not need it.

The problem is that I don’t think I really understand how to properly perform server-side authentication. Here's how I do it now:

1) The iphone client application displays the UIWebView specified in https://graph.facebook.com/oauth/authorize??client_id=<my_client_id>&redirect_uri=<my_redirect_uri>&...

2) The user is registered in facebook.

3) UIWebView is redirected to my server with an OAuth access token as a parameter. I intercept this in the iphone client application and make a request like NSURLRequest to capture the response of my server.

4) My server receives this request, drops the OAuth token, uses it to grab the facebook user ID, hides it, and sends the facebook user ID and a randomly generated password back to the iphone client application.

5) From now on, the iphone client application only works with my server via HTTPS (never again on facebook), using users_facebook_id / randomly_generated_password as credentials.

I have two questions.

1) , . , ? (.. facebook iPhone). - ?

2) facebook ios sdk, , , . , ?

!

+3
1
+2

Source: https://habr.com/ru/post/1788093/


All Articles