You are here

interface OauthInterface in Media: Acquia DAM 8

OAuth Interface.

Hierarchy

Expanded class hierarchy of OauthInterface

All classes that implement OauthInterface

1 file declares its use of OauthInterface
OauthController.php in src/Controller/OauthController.php

File

src/OauthInterface.php, line 8

Namespace

Drupal\media_acquiadam
View source
interface OauthInterface {

  /**
   * Get the URL to redirect a user to to start the oauth process.
   *
   * @return string
   *   The URL to redirect to.
   */
  public function getAuthLink();

  /**
   * Validate that the state token in an auth request is valid.
   *
   * @param string $token
   *   The CSRF token from the auth request.
   *
   * @return bool
   *   TRUE if the state is valid. FALSE otherwise.
   */
  public function authRequestStateIsValid($token);

  /**
   * Get a token for API access + the number of seconds till expiration.
   *
   * @param string $auth_code
   *   The authorization token from oauth.
   *
   * @return array
   *   Returns an array with three keys:
   *     - access_token: The access token used for API authorization.
   *     - expire_time: The unix timestamp when the access token expires.
   *     - refresh_token: The refresh token used for API authorization.
   */
  public function getAccessToken($auth_code);

  /**
   * Refresh an existing access token.
   *
   * @param string $refresh_token
   *   The refresh token.
   *
   * @return array
   *   Returns an array with three keys:
   *     - access_token: The access token used for API authorization.
   *     - expire_time: The unix timestamp when the access token expires.
   *     - refresh_token: The refresh token used for API authorization.
   */
  public function refreshAccess($refresh_token);

}

Members

Namesort descending Modifiers Type Description Overrides
OauthInterface::authRequestStateIsValid public function Validate that the state token in an auth request is valid. 1
OauthInterface::getAccessToken public function Get a token for API access + the number of seconds till expiration. 1
OauthInterface::getAuthLink public function Get the URL to redirect a user to to start the oauth process. 1
OauthInterface::refreshAccess public function Refresh an existing access token. 1