You are here

interface OAuth2ClientInterface in OAuth2 Client 8

Interface OAuth2ClientInterface.

@package Drupal\oauth2_client\Service

Hierarchy

Expanded class hierarchy of OAuth2ClientInterface

All classes that implement OAuth2ClientInterface

File

src/Service/OAuth2ClientInterface.php, line 10

Namespace

Drupal\oauth2_client\Service
View source
interface OAuth2ClientInterface {

  /**
   * Initialize an OAuth2Client object.
   *
   * @param array $params
   *   Associative array of the parameters that are needed
   *   by the different types of authorization flows.
   * @param string $id
   *   ID of the client. If not given, it will be generated
   *   from token_endpoint, client_id and auth_flow.
   */
  public function init($params = NULL, $id = NULL);

  /**
   * Clear the token data from the session.
   */
  public function clearToken();

  /**
   * Get and return an access token.
   *
   * If there is an existing token (stored in session), return that one. But if
   * the existing token is expired, get a new one from the authorization server.
   *
   * If the refresh_token has also expired and the auth_flow is 'server-side', a
   * redirection to the oauth2 server will be made, in order to re-authenticate.
   * However the redirection will be skipped if the parameter $redirect is
   * FALSE, and NULL will be returned as access_token.
   */
  public function getAccessToken($redirect = TRUE);

  /**
   * Save the information needed for redirection after getting the token.
   */
  public static function setRedirect($state, $redirect = NULL);

  /**
   * Redirect to the original path.
   *
   * Redirects are registered with OAuth2\Client::setRedirect()
   * The redirect contains the url to go to and the parameters
   * to be sent to it.
   */
  public static function redirect($clean = TRUE);

}

Members

Namesort descending Modifiers Type Description Overrides
OAuth2ClientInterface::clearToken public function Clear the token data from the session. 1
OAuth2ClientInterface::getAccessToken public function Get and return an access token. 1
OAuth2ClientInterface::init public function Initialize an OAuth2Client object. 1
OAuth2ClientInterface::redirect public static function Redirect to the original path. 1
OAuth2ClientInterface::setRedirect public static function Save the information needed for redirection after getting the token. 1