diff --git a/src/League/OAuth2/Server/Grant/RefreshToken.php b/src/League/OAuth2/Server/Grant/RefreshToken.php index 78e95269..7fe22460 100644 --- a/src/League/OAuth2/Server/Grant/RefreshToken.php +++ b/src/League/OAuth2/Server/Grant/RefreshToken.php @@ -54,6 +54,12 @@ class RefreshToken implements GrantTypeInterface { */ protected $refreshTokenTTL = 604800; + /** + * Rotate refresh tokens + * @var boolean + */ + protected $rotateRefreshTokens = false; + /** * Constructor * @param Authorization $authServer Authorization server instance @@ -111,6 +117,16 @@ class RefreshToken implements GrantTypeInterface { return $this->refreshTokenTTL; } + /** + * When a new access is token, expire the refresh token used and issue a new one. + * @param boolean $rotateRefreshTokens Set to true to enable (default = false) + * @return void + */ + public function rotateRefreshTokens($rotateRefreshTokens = false) + { + $this->rotateRefreshTokens = $rotateRefreshTokens + } + /** * Complete the refresh token grant * @param null|array $inputParams