You are here

interface SalesforceAuthProviderInterface in Salesforce Suite 8.4

Same name and namespace in other branches
  1. 8.3 src/SalesforceAuthProviderInterface.php \Drupal\salesforce\SalesforceAuthProviderInterface
  2. 5.0.x src/SalesforceAuthProviderInterface.php \Drupal\salesforce\SalesforceAuthProviderInterface

Class SalesforceAuthProvider.

Hierarchy

Expanded class hierarchy of SalesforceAuthProviderInterface

All classes that implement SalesforceAuthProviderInterface

2 files declare their use of SalesforceAuthProviderInterface
RestClientTest.php in tests/src/Unit/RestClientTest.php
SalesforceOAuthController.php in modules/salesforce_oauth/src/Controller/SalesforceOAuthController.php

File

src/SalesforceAuthProviderInterface.php, line 15

Namespace

Drupal\salesforce
View source
interface SalesforceAuthProviderInterface extends ServiceInterface, PluginFormInterface, ContainerFactoryPluginInterface, PluginInspectionInterface {
  const AUTH_TOKEN_PATH = '/services/oauth2/token';
  const AUTH_ENDPOINT_PATH = '/services/oauth2/authorize';
  const SOAP_CLASS_PATH = '/services/Soap/class/';
  const LATEST_API_VERSION = '44.0';

  /**
   * Id of this service.
   *
   * @return string
   *   Id of this service.
   */
  public function id();

  /**
   * Label of this service.
   *
   * @return string
   *   Id of this service.
   */
  public function label();

  /**
   * Perform a refresh of the given token.
   *
   * NB: This method should also refresh any associated identity.
   *
   * @param \OAuth\Common\Token\TokenInterface $token
   *   The token.
   *
   * @return \OAuth\Common\Token\TokenInterface
   *   The refreshed token.
   *
   * @throws \OAuth\OAuth2\Service\Exception\MissingRefreshTokenException
   *   Comment.
   */
  public function refreshAccessToken(TokenInterface $token);

  /**
   * Given a token, fetch the SF identity.
   *
   * @param \OAuth\Common\Token\TokenInterface $token
   *   The token.
   *
   * @return \Drupal\salesforce\Rest\SalesforceIdentityInterface
   *   The refreshed identity.
   *
   * @throws \OAuth\OAuth2\Service\Exception\MissingRefreshTokenException
   *   Comment.
   */
  public function refreshIdentity(TokenInterface $token);

  /**
   * Return the credentials configured for this auth provider instance.
   *
   * Credentials contain consumer key, login url, secret, etc.
   *
   * @return \Drupal\salesforce\Consumer\SalesforceCredentialsInterface
   *   The credentials.
   */
  public function getCredentials();

  /**
   * Access token for this plugin.
   *
   * @return \OAuth\OAuth2\Token\TokenInterface
   *   The Token.
   *
   * @throws \OAuth\Common\Storage\Exception\TokenNotFoundException
   */
  public function getAccessToken();

  /**
   * Identify for this connection.
   *
   * @return \Drupal\salesforce\Rest\SalesforceIdentityInterface
   *   Identity for this connection.
   *
   * @throws \Drupal\salesforce\IdentityNotFoundException
   *   If there is no identity.
   */
  public function getIdentity();

  /**
   * TRUE if the connection has a token, regardless of validity.
   *
   * @return bool
   *   TRUE if the connection has a token, regardless of validity.
   */
  public function hasAccessToken();

  /**
   * Clear the access token for this auth provider plugin.
   *
   * @return $this
   */
  public function revokeAccessToken();

  /**
   * Default configuration for this plugin type.
   *
   * @return array
   *   Default configuration.
   */
  public static function defaultConfiguration();

  /**
   * Authorization URL for this plugin type.
   *
   * @return string
   *   Authorization URL for this plugin type.
   */
  public function getAuthorizationEndpoint();

  /**
   * Access token URL for this plugin type.
   *
   * @return string
   *   Access token URL for this plugin type.
   */
  public function getAccessTokenEndpoint();

  /**
   * Get the globally configured API version to use.
   *
   * @return string
   *   The string name of the API version.
   */
  public function getApiVersion();

  /**
   * API Url for this plugin.
   *
   * @param string $api_type
   *   (optional) Which API for which to retrieve URL, defaults to "rest".
   *
   * @return string
   *   The URL.
   */
  public function getApiEndpoint($api_type = 'rest');

  /**
   * Instance URL for this connection.
   *
   * @return string
   *   Instance URL for this connection.
   *
   * @throws \OAuth\Common\Storage\Exception\TokenNotFoundException
   */
  public function getInstanceUrl();

  /**
   * Callback for configuration form after saving config entity.
   *
   * @param array $form
   *   The configuration form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The form state.
   */
  public function save(array $form, FormStateInterface $form_state);

  /**
   * The auth provider service.
   *
   * @return \Drupal\salesforce\SalesforceAuthProviderInterface
   *   The auth provider service.
   */
  public function service();

}

Members

Namesort descending Modifiers Type Description Overrides
ContainerFactoryPluginInterface::create public static function Creates an instance of the plugin. 112
PluginFormInterface::buildConfigurationForm public function Form constructor. 36
PluginFormInterface::submitConfigurationForm public function Form submission handler. 32
PluginFormInterface::validateConfigurationForm public function Form validation handler. 18
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2
SalesforceAuthProviderInterface::AUTH_ENDPOINT_PATH constant
SalesforceAuthProviderInterface::AUTH_TOKEN_PATH constant
SalesforceAuthProviderInterface::defaultConfiguration public static function Default configuration for this plugin type. 1
SalesforceAuthProviderInterface::getAccessToken public function Access token for this plugin. 1
SalesforceAuthProviderInterface::getAccessTokenEndpoint public function Access token URL for this plugin type. 1
SalesforceAuthProviderInterface::getApiEndpoint public function API Url for this plugin. 1
SalesforceAuthProviderInterface::getApiVersion public function Get the globally configured API version to use. 1
SalesforceAuthProviderInterface::getAuthorizationEndpoint public function Authorization URL for this plugin type. 1
SalesforceAuthProviderInterface::getCredentials public function Return the credentials configured for this auth provider instance. 1
SalesforceAuthProviderInterface::getIdentity public function Identify for this connection. 1
SalesforceAuthProviderInterface::getInstanceUrl public function Instance URL for this connection. 1
SalesforceAuthProviderInterface::hasAccessToken public function TRUE if the connection has a token, regardless of validity. 1
SalesforceAuthProviderInterface::id public function Id of this service. 1
SalesforceAuthProviderInterface::label public function Label of this service. 1
SalesforceAuthProviderInterface::LATEST_API_VERSION constant
SalesforceAuthProviderInterface::refreshAccessToken public function Perform a refresh of the given token. 1
SalesforceAuthProviderInterface::refreshIdentity public function Given a token, fetch the SF identity. 1
SalesforceAuthProviderInterface::revokeAccessToken public function Clear the access token for this auth provider plugin. 1
SalesforceAuthProviderInterface::save public function Callback for configuration form after saving config entity. 1
SalesforceAuthProviderInterface::service public function The auth provider service. 1
SalesforceAuthProviderInterface::SOAP_CLASS_PATH constant