You are here

public function AuthorizationCodeGrantService::getPostCaptureRedirect in OAuth2 Client 8.3

Provide a redirect for use following authorization code capture.

Parameters

string $pluginId: The client plugin id.

Return value

\Symfony\Component\HttpFoundation\RedirectResponse The redirect response.

File

src/Service/Grant/AuthorizationCodeGrantService.php, line 122

Class

AuthorizationCodeGrantService
Handles Authorization Grants for the OAuth2 Client module.

Namespace

Drupal\oauth2_client\Service\Grant

Code

public function getPostCaptureRedirect($pluginId) {
  $clientPlugin = $this
    ->getClient($pluginId);
  if ($clientPlugin instanceof Oauth2ClientPluginRedirectInterface) {
    return $clientPlugin
      ->getPostCaptureRedirect();
  }
  $url = Url::fromRoute('oauth2_client.oauth2_client_plugin_list');
  return new RedirectResponse($url
    ->toString(TRUE)
    ->getGeneratedUrl());
}