You are here

interface AuthManagerInterface in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/custom/social_auth_extra/src/AuthManagerInterface.php \Drupal\social_auth_extra\AuthManagerInterface
  2. 8.2 modules/custom/social_auth_extra/src/AuthManagerInterface.php \Drupal\social_auth_extra\AuthManagerInterface
  3. 8.3 modules/custom/social_auth_extra/src/AuthManagerInterface.php \Drupal\social_auth_extra\AuthManagerInterface
  4. 8.4 modules/custom/social_auth_extra/src/AuthManagerInterface.php \Drupal\social_auth_extra\AuthManagerInterface
  5. 8.5 modules/custom/social_auth_extra/src/AuthManagerInterface.php \Drupal\social_auth_extra\AuthManagerInterface
  6. 8.6 modules/custom/social_auth_extra/src/AuthManagerInterface.php \Drupal\social_auth_extra\AuthManagerInterface
  7. 8.7 modules/custom/social_auth_extra/src/AuthManagerInterface.php \Drupal\social_auth_extra\AuthManagerInterface
  8. 8.8 modules/custom/social_auth_extra/src/AuthManagerInterface.php \Drupal\social_auth_extra\AuthManagerInterface

Interface AuthManagerInterface.

@package Drupal\social_auth_extra

Hierarchy

Expanded class hierarchy of AuthManagerInterface

All classes that implement AuthManagerInterface

1 file declares its use of AuthManagerInterface
social_sso.module in modules/social_features/social_sso/social_sso.module
Module file for Social SSO.

File

modules/custom/social_auth_extra/src/AuthManagerInterface.php, line 12

Namespace

Drupal\social_auth_extra
View source
interface AuthManagerInterface {

  /**
   * Returns key-name of a social network.
   *
   * @return string
   *   Key-name of a social network.
   */
  public function getSocialNetworkKey();

  /**
   * Set instance of SDK.
   *
   * @param object $sdk
   *   SDK instance.
   *
   * @return mixed
   *   Returns mixed.
   */
  public function setSdk($sdk);

  /**
   * Returns the login URL where user will be redirected for authentication.
   *
   * @param string $type
   *   Type of action. "login" or "register".
   * @param array $scope
   *   List of permissions which should be asked during authentication.
   *
   * @return string
   *   Absolute URL.
   */
  public function getAuthenticationUrl($type, array $scope = []);

  /**
   * Reads user's access token from social network.
   *
   * @param string $type
   *   Type of action. "login" or "register".
   *
   * @return object
   *   User's access token, if it could be read from social network.
   *   Null, otherwise.
   */
  public function getAccessToken($type);

  /**
   * Returns URL to authorize/registration depending on type.
   *
   * @param string $type
   *   Type of action. "login" or "register".
   *
   * @return \Drupal\Core\GeneratedUrl|string
   *   A generated URL or a string containing an URL.
   */
  public function getRedirectUrl($type);

  /**
   * Returns object of a user profile.
   *
   * @return mixed
   *   Returns the profile.
   */
  public function getProfile();

  /**
   * Returns URL of a profile picture.
   *
   * @return string|null
   *   Absolute URL to a picture or Null if picture is not set.
   */
  public function getProfilePicture();

  /**
   * Determines preferred profile pic resolution from account settings.
   *
   * Return order: max resolution, min resolution, FALSE.
   *
   * @return array|false
   *   Array of resolution, if defined in Drupal account settings.
   *   False otherwise.
   */
  public function getPreferredResolution();

  /**
   * Set access token to AuthManager to use it for API calls.
   *
   * @param mixed $access_token
   *   Access token to use in API calls.
   *
   * @return null
   *   Returns null.
   */
  public function setAccessToken($access_token);

  /**
   * Returns an account ID on a social network.
   *
   * @return int|string
   *   The account ID on a social network.
   */
  public function getAccountId();

  /**
   * Returns first name on a social network if it possible.
   *
   * @return string|null
   *   The first name on a social network or null.
   */
  public function getFirstName();

  /**
   * Returns last name on a social network if it possible.
   *
   * @return string|null
   *   The last name on a social network or null.
   */
  public function getLastName();

  /**
   * Returns user on a social network if it possible.
   *
   * @return string|false
   *   The user name on a social network or false.
   */
  public function getUsername();

  /**
   * Set an instance of a field definition that contains picture.
   *
   * @param \Drupal\Core\Field\FieldDefinitionInterface $field
   *   The field definition containing the picture.
   *
   * @return null
   *   Returns null.
   */
  public function setFieldPicture(FieldDefinitionInterface $field);

}

Members

Namesort descending Modifiers Type Description Overrides
AuthManagerInterface::getAccessToken public function Reads user's access token from social network. 4
AuthManagerInterface::getAccountId public function Returns an account ID on a social network. 4
AuthManagerInterface::getAuthenticationUrl public function Returns the login URL where user will be redirected for authentication. 4
AuthManagerInterface::getFirstName public function Returns first name on a social network if it possible. 4
AuthManagerInterface::getLastName public function Returns last name on a social network if it possible. 4
AuthManagerInterface::getPreferredResolution public function Determines preferred profile pic resolution from account settings. 1
AuthManagerInterface::getProfile public function Returns object of a user profile. 4
AuthManagerInterface::getProfilePicture public function Returns URL of a profile picture. 4
AuthManagerInterface::getRedirectUrl public function Returns URL to authorize/registration depending on type. 1
AuthManagerInterface::getSocialNetworkKey public function Returns key-name of a social network. 4
AuthManagerInterface::getUsername public function Returns user on a social network if it possible. 1
AuthManagerInterface::setAccessToken public function Set access token to AuthManager to use it for API calls. 4
AuthManagerInterface::setFieldPicture public function Set an instance of a field definition that contains picture. 1
AuthManagerInterface::setSdk public function Set instance of SDK. 4