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

Commit a78ff2d

Browse files
committed
Merge pull request #243 from urmaul/4.0-dev
FacebookRedirectLoginHelper::getReRequestUrl
2 parents 906c5ef + b85e1ab commit a78ff2d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/Facebook/FacebookRedirectLoginHelper.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,28 @@ public function getLoginUrl($scope = array(), $version = null)
103103
http_build_query($params, null, '&');
104104
}
105105

106+
/**
107+
* Returns a URL to which the user should be sent to re-request permissions.
108+
*
109+
* @param array $scope List of permissions to re-request
110+
* @param string $version Optional Graph API version if not default (v2.0)
111+
*
112+
* @return string
113+
*/
114+
public function getReRequestUrl($scope = array(), $version = null)
115+
{
116+
$version = ($version ?: FacebookRequest::GRAPH_API_VERSION);
117+
$params = array(
118+
'client_id' => $this->appId,
119+
'redirect_uri' => $this->redirectUrl,
120+
'sdk' => 'php-sdk-' . FacebookRequest::VERSION,
121+
'auth_type' => 'rerequest',
122+
'scope' => implode(',', $scope)
123+
);
124+
return 'https://www.facebook.com/' . $version . '/dialog/oauth?' .
125+
http_build_query($params, null, '&');
126+
}
127+
106128
/**
107129
* Returns the URL to send the user in order to log out of Facebook.
108130
*

0 commit comments

Comments
 (0)