You are here

public function OpenIDConnectSession::retrieveIdToken in OpenID Connect / OAuth client 2.x

Get the id token from the session.

Parameters

bool $clear: The value is cleared from the session, if this is set to TRUE.

Return value

string|null The id token.

Overrides OpenIDConnectSessionInterface::retrieveIdToken

File

src/OpenIDConnectSession.php, line 140

Class

OpenIDConnectSession
Session service of the OpenID Connect module.

Namespace

Drupal\openid_connect

Code

public function retrieveIdToken(bool $clear = FALSE) : ?string {
  $ret = $this->session
    ->get('openid_connect_id');
  if ($clear) {
    $this->session
      ->remove('openid_connect_id');
  }
  return $ret;
}