Skip to content

Instantly share code, notes, and snippets.

@keithmancuso
Created September 30, 2014 01:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keithmancuso/226d58d0fb572face586 to your computer and use it in GitHub Desktop.
Save keithmancuso/226d58d0fb572face586 to your computer and use it in GitHub Desktop.
SalesforceOAuthProviderSource
<?php
/**
* Craft OAuth by Dukt
*
* @package Craft OAuth
* @author Benjamin David
* @copyright Copyright (c) 2014, Dukt
* @license https://dukt.net/craft/oauth/docs/license
* @link https://dukt.net/craft/oauth/
*/
namespace OAuthProviderSources;
class SalesforceOAuthProviderSource extends BaseOAuthProviderSource {
public $consoleUrl = 'https://test.salesforce.com/apps';
public function getName()
{
return 'Salesforce';
}
public function getAccount()
{
$response = $this->service->request('/me');
$response = json_decode($response, true);
$account = array();
$account['uid'] = $response['id'];
$account['name'] = $response['name'];
$account['username'] = $response['username'];
$account['email'] = $response['email'];
return $account;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment