You are here

public function ClientTestForm::testPlugin in OAuth2 Client 8.2

Test the seledted plugin by authenticating to the OAuth2 Server.

File

src/Form/ClientTestForm.php, line 292

Class

ClientTestForm
Defines the form for testing OAuth2 Client integrations.

Namespace

Drupal\oauth2_client\Form

Code

public function testPlugin(array &$form, FormStateInterface $form_state) {
  $form_state
    ->setRebuild(TRUE);

  // Attempt to retrieve an access token.
  $this->oauth2ClientService
    ->getAccessToken($form_state
    ->getValue('oauth2_client_plugin'));
}