public function consumer($service, $url = null, $scope = null)
{
// get config
$this->setConfig($service);
// get storage object
$storage = $this->createStorageInstance($this->_storageClass);
// create credentials object
$credentials = new Credentials($this->_client_id, $this->_client_secret, $url ?: URL::current());
// check if scopes were provided
if (is_null($scope)) {
// get scope from config (default to empty array)
$scope = $this->_scope;
}
// return the service consumer object
return $this->_serviceFactory->createService($service, $credentials, $storage, $scope);
}