diff --git a/config/scn-social-auth.global.php.dist b/config/scn-social-auth.global.php.dist index 9f391ac8..20cb9a59 100644 --- a/config/scn-social-auth.global.php.dist +++ b/config/scn-social-auth.global.php.dist @@ -60,6 +60,15 @@ $settings = array( */ //'facebook_display' => '', + /** + * Facebook Trust forwarded sessions + * Improves session security on shared domains + * + * @see https://github.com/facebook/facebook-php-sdk/commit/42481fa03f98465fd6dc6eb99a5124c01e8797d2 + * + */ + //'facebook_trust_forwarded' => false, + /** * Foursquare Enabled * diff --git a/src/ScnSocialAuth/Options/ModuleOptions.php b/src/ScnSocialAuth/Options/ModuleOptions.php index 77766e06..1e7a10ac 100644 --- a/src/ScnSocialAuth/Options/ModuleOptions.php +++ b/src/ScnSocialAuth/Options/ModuleOptions.php @@ -57,6 +57,11 @@ class ModuleOptions extends AbstractOptions */ protected $facebookDisplay; + /** + * @var boolean + */ + protected $facebookTrustForwarded; + /** * @var string */ @@ -422,6 +427,26 @@ public function getFacebookDisplay() return $this->facebookDisplay; } + /** + * @param boolean $facebookTrustForwarded + * + * @return ModuleOptions + */ + public function setFacebookTrustForwarded($facebookTrustForwarded) + { + $this->facebookTrustForwarded = $facebookTrustForwarded; + + return $this; + } + + /** + * @return boolean + */ + public function getFacebookTrustForwarded() + { + return $this->facebookTrustForwarded; + } + /** * set foursquare enabled * diff --git a/src/ScnSocialAuth/Service/HybridAuthFactory.php b/src/ScnSocialAuth/Service/HybridAuthFactory.php index a004e077..013e0fdd 100644 --- a/src/ScnSocialAuth/Service/HybridAuthFactory.php +++ b/src/ScnSocialAuth/Service/HybridAuthFactory.php @@ -43,6 +43,7 @@ public function createService(ServiceLocatorInterface $services) ), 'scope' => $options->getFacebookScope(), 'display' => $options->getFacebookDisplay(), + 'trustForwarded' => $options->getFacebookTrustForwarded(), ), 'Foursquare' => array( 'enabled' => $options->getFoursquareEnabled(),