Reputation: 21
How to make only https facebook app? Couse this code:
$signed_request = $_REQUEST["signed_request"];
list($encoded_sig, $payload) = explode('.', $signed_request, 2);
$data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);
if(empty($data["page"]["liked"]))
work in only https.
Thanks for answer.
Upvotes: 0
Views: 158
Reputation: 1058
Only put a HTTPS/secure url in the Application (Canvas or App) Settings.
Leave the Canvas URL blank. And the Secure Canvas URL Populated.
In addition you can configure your server to Redirect Non HTTP Requests to HTTPS so your Application only servers over HTTPS.
-- Additional
Given your code only works over HTTPS it seems requests to HTTP are being redirected to HTTPS which in my experience tends to drop $_POST'ed data during the redirect as is the case when Facebook loads your App. Which is why your code trips up because the $_REQUEST is blank/signed_request is missing.
Upvotes: 1