Skip to content

Commit

Permalink
Merge pull request #42 from frankkessler/analysis-z9RWbN
Browse files Browse the repository at this point in the history
Applied fixes from StyleCI
  • Loading branch information
frankkessler committed Oct 5, 2016
2 parents bb80959 + 38af364 commit 0e034a8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions config/salesforce.php
Expand Up @@ -30,10 +30,10 @@
],

'jwt' => [
'private_key' => env('SALESFORCE_OAUTH_JWT_PRIVATE_KEY'),
'private_key' => env('SALESFORCE_OAUTH_JWT_PRIVATE_KEY'),
'private_key_passphrase' => env('SALESFORCE_OAUTH_JWT_PRIVATE_KEY_PASSPHRASE'),
'run_as_user_name' => env('SALESFORCE_OAUTH_JWT_RUN_AS_USER_NAME'),
]
'run_as_user_name' => env('SALESFORCE_OAUTH_JWT_RUN_AS_USER_NAME'),
],
],
'storage_type' => 'eloquent',
'storage_global_user_id' => null,
Expand Down
26 changes: 13 additions & 13 deletions src/Salesforce.php
Expand Up @@ -84,33 +84,33 @@ public function setupOauthClient()
if (isset($this->config_local['token_url'])) {
$token_url = $this->config_local['token_url'];
} else {
$token_url = 'https://' . SalesforceConfig::get('salesforce.oauth.domain') . SalesforceConfig::get('salesforce.oauth.token_uri');
$token_url = 'https://'.SalesforceConfig::get('salesforce.oauth.domain').SalesforceConfig::get('salesforce.oauth.token_uri');
}

if(SalesforceConfig::get('salesforce.oauth.auth_type') == 'jwt_web_token') {
if (SalesforceConfig::get('salesforce.oauth.auth_type') == 'jwt_web_token') {
$jwt_token_config = [
'client_id' => SalesforceConfig::get('salesforce.oauth.consumer_token'),
'client_secret' => SalesforceConfig::get('salesforce.oauth.consumer_secret'),
'token_url' => $token_url,
'auth_location' => 'body',
'jwt_private_key' => SalesforceConfig::get('salesforce.oauth.jwt.private_key'),
'client_id' => SalesforceConfig::get('salesforce.oauth.consumer_token'),
'client_secret' => SalesforceConfig::get('salesforce.oauth.consumer_secret'),
'token_url' => $token_url,
'auth_location' => 'body',
'jwt_private_key' => SalesforceConfig::get('salesforce.oauth.jwt.private_key'),
'jwt_private_key_passphrase' => SalesforceConfig::get('salesforce.oauth.jwt.private_key_passphrase'),
'jwt_algorithm' => 'RS256',
'jwt_payload' => [
'jwt_algorithm' => 'RS256',
'jwt_payload' => [
'sub' => SalesforceConfig::get('salesforce.oauth.jwt.run_as_user_name'),
'aud' => 'https://'.SalesforceConfig::get('salesforce.oauth.domain'),
]
],
];
$grantType = new JwtBearer($jwt_token_config);
$this->oauth2Client->setGrantType($grantType);
}else{ //web_server is default auth type
} else { //web_server is default auth type
$this->oauth2Client->setRefreshToken($refresh_token);

$refresh_token_config = [
'client_id' => SalesforceConfig::get('salesforce.oauth.consumer_token'),
'client_id' => SalesforceConfig::get('salesforce.oauth.consumer_token'),
'client_secret' => SalesforceConfig::get('salesforce.oauth.consumer_secret'),
'refresh_token' => $refresh_token,
'token_url' => $token_url,
'token_url' => $token_url,
'auth_location' => 'body',
];
$this->oauth2Client->setRefreshTokenGrantType(new RefreshToken($refresh_token_config));
Expand Down

0 comments on commit 0e034a8

Please sign in to comment.