Renamed setExpiresIn method to accessTokenTTL

This commit is contained in:
Alex Bilbie 2013-05-07 15:16:30 -07:00
parent 5df1338046
commit 8fd9e3f312
5 changed files with 23 additions and 23 deletions

View File

@ -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;
}
/**

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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();