Facebook login - detect user logged in without PHP-SDK
-
I've built custom login flow for facebook login according to https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/ ... Is it enaugh to consider user as facebook-valid-user-logged-in if the access_token retrieval (Exchanging code for an access token) was successful (no GET error)? Is facebook access_token something unique to the user and something that can only be "generated by the user"? Or should I try to retrieve user info with that access_token and after successfully checking it(that it has information requested in permission e.g. email) then only after that consider him as facebook-valid-user-logged-in? PS: I do not want to use Facebook PHP-SDK
-
Answer:
If you have a requirement to not use an official SDK then I would say that you should validate the tokens you retrieve by querying /me. This is the best way to make sure that you are dealing with a valid token as it is verified by Facebook when you use it for a request. If the token you are using is not valid, you'll get a response similar to this: { error: { message: "Invalid OAuth access token.", type: "OAuthException", code: 190 } } User access tokens are unique per user and per application. Each application will return a different token for the same user. Application access tokens are unique per application and do not require any requests to Facebook in order to retrieve them - they are just a concatenation between the app_id and app_secret: app_id|app_secret as https://developers.facebook.com/docs/facebook-login/access-tokens/ There is another method to make calls to the Graph API that doesn't require using a generated app token. You can just pass your app id and app secret as the access_token parameter when you make a call: http://graph.facebook.com/endpoint?key=value&access_token=app_id|app_secret The choice to use a generated access token vs. this method depends on where you hide your app secret.
jave.web at Stack Overflow Visit the source
Related Q & A:
- How To Login To Facebook?Best solution by Stack Overflow
- How To Login Facebook In School?Best solution by wikihow.com
- How To Detect Who Is Online In Facebook?Best solution by Stack Overflow
- How can I make Private Messages in Drupal 7 with user user pictures like in Facebook?Best solution by Drupal Answers
- How to use Facebook login in a modal view in iOS SDK?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.