简体   繁体   中英

only htpps fb app

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM