You are here

public function AccessToken::isRefreshToken in Simple OAuth (OAuth2) & OpenID Connect 8

Helper function that indicates if a token is a refresh token.

Return value

bool TRUE if this is a refresh token. FALSE otherwise.

Overrides AccessTokenInterface::isRefreshToken

3 calls to AccessToken::isRefreshToken()
AccessToken::hasPermission in src/Entity/AccessToken.php
Checks if the current token allows the provided permission.
AccessToken::postSave in src/Entity/AccessToken.php
Acts on a saved entity before the insert or update hook is invoked.
AccessToken::refresh in src/Entity/AccessToken.php
If this is an refresh token, the refresh token will refresh and provide a new access token

File

src/Entity/AccessToken.php, line 301

Class

AccessToken
Defines the Access Token entity.

Namespace

Drupal\simple_oauth\Entity

Code

public function isRefreshToken() {
  return !$this
    ->get('access_token_id')
    ->isEmpty() && $this
    ->get('resource')->target_id == 'authentication';
}