I want the user to be redirected to a particular webpage after logging in using Facebook. I created a LoginUrl using Facebook PHP SDK and the user clicks on this link to log in. I followed http://developers.facebook.com/docs/reference/php/facebook-getLoginUrl/ when using the $facebook->getLoginUrl()
Problem: If I were to include the redirect_uri parameter, Facebook gives me an error An error occurred. Please try again later. The login url works fine without including the redirect_uri.
Anyone knows how to fix this? Thanks!
Non-working PHP Code
$loginUrl = $facebook->getLoginUrl(array(
"scope" => "email,user_education_history,user_work_history",
"redirect_uri" => "http://mydomain.com/login/facebook"
));
Working PHP Code
$loginUrl = $facebook->getLoginUrl(array(
"scope" => "email,user_education_history,user_work_history",
));