You are here

protected function SalesforceJWTPlugin::generateAssertionClaim in Salesforce Suite 8.4

Same name and namespace in other branches
  1. 5.0.x modules/salesforce_jwt/src/Plugin/SalesforceAuthProvider/SalesforceJWTPlugin.php \Drupal\salesforce_jwt\Plugin\SalesforceAuthProvider\SalesforceJWTPlugin::generateAssertionClaim()

Returns a JSON encoded JWT Claim.

Return value

array The claim array.

1 call to SalesforceJWTPlugin::generateAssertionClaim()
SalesforceJWTPlugin::generateAssertion in modules/salesforce_jwt/src/Plugin/SalesforceAuthProvider/SalesforceJWTPlugin.php
Returns a JWT Assertion to authenticate.

File

modules/salesforce_jwt/src/Plugin/SalesforceAuthProvider/SalesforceJWTPlugin.php, line 211

Class

SalesforceJWTPlugin
JWT Oauth plugin.

Namespace

Drupal\salesforce_jwt\Plugin\SalesforceAuthProvider

Code

protected function generateAssertionClaim() {
  $cred = $this
    ->getCredentials();
  return [
    'iss' => $cred
      ->getConsumerKey(),
    'sub' => $cred
      ->getLoginUser(),
    'aud' => $cred
      ->getLoginUrl(),
    'exp' => \Drupal::time()
      ->getCurrentTime() + 60,
  ];
}