You are here

public function OAuth2Client::__construct in OAuth2 Client 8

Construct an OAuth2Client object.

Parameters

\GuzzleHttp\ClientInterface $httpClient: The HTTP Request client.

\Symfony\Component\HttpFoundation\RequestStack $requestStack: The Request Stack.

\Drupal\Core\TempStore\PrivateTempStoreFactory $tempstore: The user private tempstore - acts like $_SESSION.

File

src/Service/OAuth2Client.php, line 119

Class

OAuth2Client
OAuth2Client service.

Namespace

Drupal\oauth2_client\Service

Code

public function __construct(ClientInterface $httpClient, RequestStack $requestStack, PrivateTempStoreFactory $tempstore) {
  $this->httpClient = $httpClient;
  $this->requestStack = $requestStack;
  $this->tempstore = $tempstore
    ->get('oauth2_client');
}