diff --git a/src/OAuth2/AuthServer.php b/src/OAuth2/AuthServer.php index e9e302f5..d49be227 100644 --- a/src/OAuth2/AuthServer.php +++ b/src/OAuth2/AuthServer.php @@ -356,11 +356,11 @@ class AuthServer /** * Set the TTL for an access token - * @param int $expiresIn The new TTL + * @param int $accessTokenTTL The new TTL */ - public function setExpiresIn($expiresIn) + public function setAcessTokenTTL($accessTokenTTL) { - $this->expiresIn = $expiresIn; + $this->accessTokenTTL = $accessTokenTTL; } /** diff --git a/src/OAuth2/Grant/AuthCode.php b/src/OAuth2/Grant/AuthCode.php index 67dc2234..4433bf56 100644 --- a/src/OAuth2/Grant/AuthCode.php +++ b/src/OAuth2/Grant/AuthCode.php @@ -46,7 +46,7 @@ class AuthCode implements GrantTypeInterface { * Access token expires in override * @var int */ - protected $expiresIn = null; + protected $accessTokenTTL = null; /** * Constructor @@ -78,12 +78,12 @@ class AuthCode implements GrantTypeInterface { /** * Override the default access token expire time - * @param int $expiresIn + * @param int $accessTokenTTL * @return void */ - public function setExpiresIn($expiresIn) + public function setAccessTokenTTL($accessTokenTTL) { - $this->expiresIn = $expiresIn; + $this->accessTokenTTL = $accessTokenTTL; } /** @@ -238,7 +238,7 @@ class AuthCode implements GrantTypeInterface { // A session ID was returned so update it with an access token and remove the authorisation code $accessToken = SecureKey::make(); - $accessTokenExpiresIn = ($this->expiresIn !== null) ? $this->expiresIn : $this->authServer->getExpiresIn(); + $accessTokenExpiresIn = ($this->accessTokenTTL !== null) ? $this->accessTokenTTL : $this->authServer->getExpiresIn(); $accessTokenExpires = time() + $accessTokenExpiresIn; // Remove the auth code diff --git a/src/OAuth2/Grant/ClientCredentials.php b/src/OAuth2/Grant/ClientCredentials.php index 5d2a48a9..489bc5a5 100644 --- a/src/OAuth2/Grant/ClientCredentials.php +++ b/src/OAuth2/Grant/ClientCredentials.php @@ -46,7 +46,7 @@ class ClientCredentials implements GrantTypeInterface { * Access token expires in override * @var int */ - protected $expiresIn = null; + protected $accessTokenTTL = null; /** * Constructor @@ -78,12 +78,12 @@ class ClientCredentials implements GrantTypeInterface { /** * Override the default access token expire time - * @param int $expiresIn + * @param int $accessTokenTTL * @return void */ - public function setExpiresIn($expiresIn) + public function setAccessTokenTTL($accessTokenTTL) { - $this->expiresIn = $expiresIn; + $this->accessTokenTTL = $accessTokenTTL; } /** @@ -142,7 +142,7 @@ class ClientCredentials implements GrantTypeInterface { // Generate an access token $accessToken = SecureKey::make(); - $accessTokenExpiresIn = ($this->expiresIn !== null) ? $this->expiresIn : $this->authServer->getExpiresIn(); + $accessTokenExpiresIn = ($this->accessTokenTTL !== null) ? $this->accessTokenTTL : $this->authServer->getExpiresIn(); $accessTokenExpires = time() + $accessTokenExpiresIn; // Delete any existing sessions just to be sure diff --git a/src/OAuth2/Grant/Password.php b/src/OAuth2/Grant/Password.php index dbc94eb9..31cc7080 100644 --- a/src/OAuth2/Grant/Password.php +++ b/src/OAuth2/Grant/Password.php @@ -52,7 +52,7 @@ class Password implements GrantTypeInterface { * Access token expires in override * @var int */ - protected $expiresIn = null; + protected $accessTokenTTL = null; /** * Constructor @@ -84,12 +84,12 @@ class Password implements GrantTypeInterface { /** * Override the default access token expire time - * @param int $expiresIn + * @param int $accessTokenTTL * @return void */ - public function setExpiresIn($expiresIn) + public function setAccessTokenTTL($accessTokenTTL) { - $this->expiresIn = $expiresIn; + $this->accessTokenTTL = $accessTokenTTL; } /** @@ -185,7 +185,7 @@ class Password implements GrantTypeInterface { // Generate an access token $accessToken = SecureKey::make(); - $accessTokenExpiresIn = ($this->expiresIn !== null) ? $this->expiresIn : $this->authServer->getExpiresIn(); + $accessTokenExpiresIn = ($this->accessTokenTTL !== null) ? $this->accessTokenTTL : $this->authServer->getExpiresIn(); $accessTokenExpires = time() + $accessTokenExpiresIn; // Delete any existing sessions just to be sure diff --git a/src/OAuth2/Grant/RefreshToken.php b/src/OAuth2/Grant/RefreshToken.php index 586c482f..6869f0ca 100644 --- a/src/OAuth2/Grant/RefreshToken.php +++ b/src/OAuth2/Grant/RefreshToken.php @@ -46,7 +46,7 @@ class RefreshToken implements GrantTypeInterface { * Access token expires in override * @var int */ - protected $expiresIn = null; + protected $accessTokenTTL = null; /** * Constructor @@ -78,12 +78,12 @@ class RefreshToken implements GrantTypeInterface { /** * Override the default access token expire time - * @param int $expiresIn + * @param int $accessTokenTTL * @return void */ - public function setExpiresIn($expiresIn) + public function setAccessTokenTTL($accessTokenTTL) { - $this->expiresIn = $expiresIn; + $this->accessTokenTTL = $accessTokenTTL; } /** @@ -132,7 +132,7 @@ class RefreshToken implements GrantTypeInterface { // Generate new tokens and associate them to the session $accessToken = SecureKey::make(); - $accessTokenExpiresIn = ($this->expiresIn !== null) ? $this->expiresIn : $this->authServer->getExpiresIn(); + $accessTokenExpiresIn = ($this->accessTokenTTL !== null) ? $this->accessTokenTTL : $this->authServer->getExpiresIn(); $accessTokenExpires = time() + $accessTokenExpiresIn; $refreshToken = SecureKey::make();