Created
September 30, 2014 01:54
-
-
Save keithmancuso/226d58d0fb572face586 to your computer and use it in GitHub Desktop.
SalesforceOAuthProviderSource
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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