facebookarchive / php-graph-sdk

The Facebook SDK for PHP provides a native interface to the Graph API and Facebook Login. https://developers.facebook.com/docs/php
Other
3.17k stars 1.95k forks source link

SDK doesn't properly detect HTTPS when used behind load balancer #1137

Open webmasterlv opened 5 years ago

webmasterlv commented 5 years ago

We have a load balancer server that has httpS enabled and multiple other servers behind it who are actual websites. Traffic between internal servers is http.

The problem is, getRedirectLoginHelper that calls urlDetectionHandler detects that server is running http. That's true, but then redirect_uri it generates, comes out as http and we get _OAuth "Facebook Platform" "redirect_urimismatch" error even when we pass correct redirect_uri with httpS in it.

There should be option to strictly force https for getRedirectLoginHelper function.

tolbon commented 4 years ago

Try to use $config['url_detection_handler'] in construct of Facebook class with your implements of UrlDetectionInterface or extends of FacebookUrlDetectionHandler