public function RefreshToken::getGrantType in Simple OAuth (OAuth2) & OpenID Connect 5.x
Same name and namespace in other branches
- 8.4 src/Plugin/Oauth2Grant/RefreshToken.php \Drupal\simple_oauth\Plugin\Oauth2Grant\RefreshToken::getGrantType()
Gets the grant object.
Return value
League\OAuth2\Server\Grant\GrantTypeInterface The grant type.
Overrides Oauth2GrantInterface::getGrantType
File
- src/
Plugin/ Oauth2Grant/ RefreshToken.php, line 60
Class
- RefreshToken
- The refresh token grant plugin.
Namespace
Drupal\simple_oauth\Plugin\Oauth2GrantCode
public function getGrantType() {
$grant = new RefreshTokenGrant($this->refreshTokenRepository);
$settings = $this->configFactory
->get('simple_oauth.settings');
$grant
->setRefreshTokenTTL(new \DateInterval(sprintf('PT%dS', $settings
->get('refresh_token_expiration'))));
return $grant;
}