php - Simplified facebook connect -


i followed links :http://code.tutsplus.com/tutorials/how-to-authenticate-your-users-with-facebook-connect--net-12302 , many others.i made simplified code out of it. gives no errors but, issue login link never turned logout. error in url error=access_denied&error_code=200&error_description=permissions+error&error_reason=user_denied&code=..some long string here.. have set app public , available users.

<!doctype> <html>   <head>     <title> test</title>   </head>   <body>   <?php      include 'libs/facebook.php';     $facebook=new facebook(array(        'appid'=> '###',        'secret'=>'***',        'cookie'=>false     ));     $user=$facebook->getuser();     $me=null;     if($user){        try{          $me=$facebook->api('/me');        }        catch(facebookapiexception $e){          echo $e->getmessage();        }     }     if($me){        echo $me;        $logouturl=$facebook->getlogouturl();        echo "<a href='$logouturl'>logout</a>";        //echo "in log out url";     }     else{        echo "$me";        $loginurl=$facebook->getloginurl();        echo "<a href='$loginurl'>login</a>";       // echo "login url";     }   ?>    </body> </html> 

there reason like:

  • app_id , app_secret may wrong you've entered in code. pl re-check

  • chec kthe site url in app settings- configured correctly?


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -