JWTCredentials.php in Salesforce Suite 5.0.x
File
modules/salesforce_jwt/src/Consumer/JWTCredentials.php
View source
<?php
namespace Drupal\salesforce_jwt\Consumer;
use Drupal\salesforce\Consumer\SalesforceCredentials;
class JWTCredentials extends SalesforceCredentials {
protected $loginUser;
protected $keyId;
public function __construct($consumerKey, $loginUrl, $loginUser, $keyId) {
parent::__construct($consumerKey, NULL, NULL);
$this->consumerKey = $consumerKey;
$this->loginUrl = $loginUrl;
$this->loginUser = $loginUser;
$this->keyId = $keyId;
}
public static function create(array $configuration) {
return new static($configuration['consumer_key'], $configuration['login_url'], $configuration['login_user'], $configuration['encrypt_key']);
}
public function getLoginUser() {
return $this->loginUser;
}
public function getKeyId() {
return $this->keyId;
}
public function isValid() {
return !empty($this->loginUser) && !empty($this->consumerId) && !empty($this->keyId);
}
}