mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-16 10:18:55 +05:30
Renamed setExpiresIn method to accessTokenTTL
This commit is contained in:
parent
5df1338046
commit
8fd9e3f312
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user