Currently, for authentication for my Facebook App, I'm doing the following in PHP:
if($_GET["code"] == null)
{
Header("Location: https://graph.facebook.com/oauth/authorize?
client_id=[MY_APP_ID]&
redirect_uri=[THIS_CURRENT_URL]&
scope=publish_stream");
exit();
}
else if($_GET["access_token"] == null)
{
$code = $_GET["code"];
Header("Location: https://graph.facebook.com/oauth/access_token?
client_id=[MY_APP_ID]&
redirect_uri=[THIS_CURRENT_URL]&
client_secret=[MY_APP_SECRET]&
code=$code");
exit();
}
else
{
echo($_GET["access_token"]);
}
Is this safe/proper? Couldn't a malicious user just "intercept" the redirects and see my App ID and App Secret?