Skip to content

Commit

Permalink
Merge pull request #143 from jeffery/fix-facebook-trust-forwarded-ses…
Browse files Browse the repository at this point in the history
…sions

Adding config to allow Facebook auth to trust forwarded sessions
  • Loading branch information
SocalNick committed Jun 6, 2014
2 parents b38f2aa + 35fb162 commit cbb85fe
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
9 changes: 9 additions & 0 deletions config/scn-social-auth.global.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
25 changes: 25 additions & 0 deletions src/ScnSocialAuth/Options/ModuleOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ class ModuleOptions extends AbstractOptions
*/
protected $facebookDisplay;

/**
* @var boolean
*/
protected $facebookTrustForwarded;

/**
* @var string
*/
Expand Down Expand Up @@ -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
*
Expand Down
1 change: 1 addition & 0 deletions src/ScnSocialAuth/Service/HybridAuthFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function createService(ServiceLocatorInterface $services)
),
'scope' => $options->getFacebookScope(),
'display' => $options->getFacebookDisplay(),
'trustForwarded' => $options->getFacebookTrustForwarded(),
),
'Foursquare' => array(
'enabled' => $options->getFoursquareEnabled(),
Expand Down

0 comments on commit cbb85fe

Please sign in to comment.