class JWTCredentials in Salesforce Suite 5.0.x
Same name and namespace in other branches
- 8.4 modules/salesforce_jwt/src/Consumer/JWTCredentials.php \Drupal\salesforce_jwt\Consumer\JWTCredentials
JWT credentials.
Hierarchy
- class \Drupal\salesforce\Consumer\SalesforceCredentials extends \OAuth\Common\Consumer\Credentials implements SalesforceCredentialsInterface
- class \Drupal\salesforce_jwt\Consumer\JWTCredentials
Expanded class hierarchy of JWTCredentials
File
- modules/
salesforce_jwt/ src/ Consumer/ JWTCredentials.php, line 10
Namespace
Drupal\salesforce_jwt\ConsumerView source
class JWTCredentials extends SalesforceCredentials {
/**
* Pre-authorized login user for JWT OAuth authentication.
*
* @var string
*/
protected $loginUser;
/**
* Id of authorization key for this JWT Credential.
*
* @var string
*/
protected $keyId;
/**
* {@inheritdoc}
*/
public function __construct($consumerKey, $loginUrl, $loginUser, $keyId) {
parent::__construct($consumerKey, NULL, NULL);
$this->consumerKey = $consumerKey;
$this->loginUrl = $loginUrl;
$this->loginUser = $loginUser;
$this->keyId = $keyId;
}
/**
* Constructor helper.
*
* @param array $configuration
* Plugin configuration.
*
* @return \Drupal\salesforce_jwt\Consumer\JWTCredentials
* Credentials, valid or not.
*/
public static function create(array $configuration) {
return new static($configuration['consumer_key'], $configuration['login_url'], $configuration['login_user'], $configuration['encrypt_key']);
}
/**
* Login user getter.
*
* @return string
* The login user.
*/
public function getLoginUser() {
return $this->loginUser;
}
/**
* Authorization key getter.
*
* @return string
* The key id.
*/
public function getKeyId() {
return $this->keyId;
}
/**
* {@inheritdoc}
*/
public function isValid() {
return !empty($this->loginUser) && !empty($this->consumerId) && !empty($this->keyId);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
JWTCredentials:: |
protected | property | Id of authorization key for this JWT Credential. | |
JWTCredentials:: |
protected | property | Pre-authorized login user for JWT OAuth authentication. | |
JWTCredentials:: |
public static | function |
Constructor helper. Overrides SalesforceCredentials:: |
|
JWTCredentials:: |
public | function | Authorization key getter. | |
JWTCredentials:: |
public | function | Login user getter. | |
JWTCredentials:: |
public | function |
Sanity check for credentials validity. Overrides SalesforceCredentials:: |
|
JWTCredentials:: |
public | function | ||
SalesforceCredentials:: |
protected | property | Consumer key for the Salesforce connected OAuth app. | |
SalesforceCredentials:: |
protected | property | Login URL e.g. https://test.salesforce.com or https://login.salesforce.com. | |
SalesforceCredentials:: |
public | function |
Get the consumer key for these credentials. Overrides SalesforceCredentialsInterface:: |
|
SalesforceCredentials:: |
public | function |
Get the login URL for these credentials. Overrides SalesforceCredentialsInterface:: |