public function getAuthorizeUri($redirect_uri, $scope = Client::SCOPE_READ) {

		$state = sha1(mt_rand());

		$_SESSION[$this->oauth_key] = [
			'redirect_uri'	=> $redirect_uri,
			'scope'			=> $scope,
			'state'			=> $state,
		];

		return $this->client->authorizationEndpoint() . '?' . http_build_query([
			'response_type'	=> 'code',
			'client_id'		=> $this->client->id(),
			'client_secret' => $this->client->secret(),
			'redirect_uri'	=> $redirect_uri,
			'scope'			=> $scope,
			'state'			=> $state,
		]);
	}
public function getAuthorizeUri($redirect_uri, $scope = Client::SCOPE_READ) {

		$state = sha1(mt_rand());

		$_SESSION[$this->oauth_key] = [
			'redirect_uri'	=> $redirect_uri,
			'scope'			=> $scope,
			'state'			=> $state,
		];

		return $this->client->authorizationEndpoint() . '?' . http_build_query([
			'response_type'	=> 'code',
			'client_id'		=> $this->client->id(),
			'client_secret' => $this->client->secret(),
			'redirect_uri'	=> $redirect_uri,
			'scope'			=> $scope,
			'state'			=> $state,
		]);
	}
public function getAuthorizeUri ( $ redirect_uri , $ scope = Client :: SCOPE_READ ) { $ state = sha1 ( mt_rand ( ) ) ; $ _SESSION [ $ this -> oauth_key ] = [ 'redirect_uri' => $ redirect_uri , 'scope' => $ scope , 'state' => $ state , ] ; return $ this -> client -> authorizationEndpoint ( ) . '?' . http_build_query ( [ 'response_type' => 'code' , 'client_id' => $ this -> client -> id ( ) , 'client_secret' => $ this -> client -> secret ( ) , 'redirect_uri' => $ redirect_uri , 'scope' => $ scope , 'state' => $ state , ] ) ; }
Generate and return the authorization URI.

@param string $redirect_uri
@param string $scope (optional)
@return string
Generate and return the authorization URI .