コード例 #1
0
 /**
  * Generates an authorization URL to begin the process of authenticating a user.
  *
  * @param string $redirectUrl The callback URL to redirect to.
  * @param array  $scope       An array of permissions to request.
  * @param string $state       The CSPRNG-generated CSRF value.
  * @param array  $params      An array of parameters to generate URL.
  * @param string $separator   The separator to use in http_build_query().
  *
  * @return string
  */
 public function getAuthorizationUrl($redirectUrl, $state, array $scope = [], array $params = [], $separator = '&')
 {
     $params += ['client_id' => $this->app->getId(), 'state' => $state, 'response_type' => 'code', 'sdk' => 'php-sdk-' . Facebook::VERSION, 'redirect_uri' => $redirectUrl, 'scope' => implode(',', $scope)];
     return $this->client->getBaseGraphUrl() . '/api/v1/oauth/authorize?' . http_build_query($params, null, $separator);
 }