abstract class OAuth2Manager in Social API 8.2
Same name and namespace in other branches
- 3.x src/AuthManager/OAuth2Manager.php \Drupal\social_api\AuthManager\OAuth2Manager
Defines basic OAuth2Manager to be used by social auth and social post.
@package Drupal\social_api
Hierarchy
- class \Drupal\social_api\AuthManager\OAuth2Manager implements OAuth2ManagerInterface
Expanded class hierarchy of OAuth2Manager
File
- src/
AuthManager/ OAuth2Manager.php, line 14
Namespace
Drupal\social_api\AuthManagerView source
abstract class OAuth2Manager implements OAuth2ManagerInterface {
/**
* The service client.
*
* @var \League\OAuth2\Client\Provider\AbstractProvider|mixed
*/
protected $client;
/**
* Access token for OAuth2 authentication.
*
* @var \League\OAuth2\Client\Token\AccessToken|string|mixed
*/
protected $accessToken;
/**
* Social Auth implementer settings.
*
* @var \Drupal\Core\Config\ImmutableConfig
*/
protected $settings;
/**
* The logger factory.
*
* @var \Drupal\Core\Logger\LoggerChannelFactoryInterface
*/
protected $loggerFactory;
/**
* The current request.
*
* @var \Symfony\Component\HttpFoundation\Request|null
*/
protected $request;
/**
* The user returned by the provider.
*
* @var \League\OAuth2\Client\Provider\GenericResourceOwner|array|mixed
*/
protected $user;
/**
* OAuth2Manager Constructor.
*
* @param \Drupal\Core\Config\ImmutableConfig $settings
* The implementer settings.
* @param \Drupal\Core\Logger\LoggerChannelFactoryInterface $logger_factory
* The logger factory.
* @param \Symfony\Component\HttpFoundation\Request $request
* The current request.
*/
public function __construct(ImmutableConfig $settings, LoggerChannelFactoryInterface $logger_factory, Request $request = NULL) {
$this->settings = $settings;
$this->loggerFactory = $logger_factory;
$this->request = $request;
}
/**
* {@inheritdoc}
*/
public function setClient($client) {
$this->client = $client;
return $this;
}
/**
* {@inheritdoc}
*/
public function getClient() {
return $this->client;
}
/**
* {@inheritdoc}
*/
public function getAccessToken() {
return $this->accessToken;
}
/**
* {@inheritdoc}
*/
public function setAccessToken($access_token) {
$this->accessToken = $access_token;
return $this;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
OAuth2Manager:: |
protected | property | Access token for OAuth2 authentication. | |
OAuth2Manager:: |
protected | property | The service client. | |
OAuth2Manager:: |
protected | property | The logger factory. | |
OAuth2Manager:: |
protected | property | The current request. | |
OAuth2Manager:: |
protected | property | Social Auth implementer settings. | |
OAuth2Manager:: |
protected | property | The user returned by the provider. | |
OAuth2Manager:: |
public | function |
Gets the access token after authentication. Overrides OAuth2ManagerInterface:: |
|
OAuth2Manager:: |
public | function |
Gets the service client object. Overrides OAuth2ManagerInterface:: |
|
OAuth2Manager:: |
public | function |
Sets the access token. Overrides OAuth2ManagerInterface:: |
|
OAuth2Manager:: |
public | function |
Sets the provider client. Overrides OAuth2ManagerInterface:: |
|
OAuth2Manager:: |
public | function | OAuth2Manager Constructor. | |
OAuth2ManagerInterface:: |
public | function | Authenticates the user. | |
OAuth2ManagerInterface:: |
public | function | Returns the authorization URL where user will be redirected. | |
OAuth2ManagerInterface:: |
public | function | Returns OAuth2 state. | |
OAuth2ManagerInterface:: |
public | function | Gets data about the user. |