Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

FacebookRedirectLoginHelper::getReRequestUrl #243

Merged
merged 3 commits into from
Oct 9, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/Facebook/FacebookRedirectLoginHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,28 @@ public function getLoginUrl($scope = array(), $version = null)
http_build_query($params, null, '&');
}

/**
* Returns a URL to which the user should be sent to re-request permissions.
*
* @param array $scope List of permissions to re-request
* @param string $version Optional Graph API version if not default (v2.0)
*
* @return string
*/
public function getReRequestUrl($scope = array(), $version = null)
{
$version = ($version ?: FacebookRequest::GRAPH_API_VERSION);
$params = array(
'client_id' => $this->appId,
'redirect_uri' => $this->redirectUrl,
'sdk' => 'php-sdk-' . FacebookRequest::VERSION,
'auth_type' => 'rerequest',
'scope' => implode(',', $scope)
);
return 'https://www.facebook.com/' . $version . '/dialog/oauth?' .
http_build_query($params, null, '&');
}

/**
* Returns the URL to send the user in order to log out of Facebook.
*
Expand Down