php - Facebook API - Authenticate Specific User..? -
php - Facebook API - Authenticate Specific User..? -
i'm connecting facebook api via simple examples posted in facebook developers' documentation
$code = $_get["code"]; if(empty($code)) { // long scope, i've tested it, , there aren't errors here. $dialog_url = "http://www.facebook.com/dialog/oauth?client_id=" . $app_id . "&redirect_uri=" . urlencode($my_url) . '&scope=email,read_stream,publish_stream,read_mailbox,read_requests,create_event, manage_pages,publish_checkins,manage_friendlists,read_friendlists,user_about_me, user_activities,user_birthday,user_checkins,user_education_history,user_events, user_hometown,user_interests,user_likes,user_location,user_photo_video_tags, user_photos,user_relationship_details,user_relationships,user_religion_politics, user_status,user_videos,user_website,user_work_history'; echo "<script> window.location.href='" . $dialog_url . "'</script>"; } i utilize callback acquire access token , run check see if user in database. however, i've noticed if log in different facebook business relationship , utilize login stored in database log user in, when authenticates, it's logged in facebook user.
my question is: there way alter above authentication code utilize facebook user id stored in database , authenticate user specifically.
for example, if user active facebook session not user logging in site, end current session (log out of facebook) , request user log in facebook.
there 2 ways authenticate user in facebook api, online , offline. when logged in facebook 1 user , want access another, in fact accessing other user in offline mode. need offline access permission. after have permission, can follow procedure in question: facebook offline access step-by-step
a side note: experience, people don't give offline_access permission. inquire if really need it, , understand might limit amount of users utilize app. 2 cents.
php facebook api oauth
Comments
Post a Comment