diff --git a/src/Entity/AbstractToken.php b/src/Entity/AbstractToken.php index 02c8efee..18e3c5e8 100644 --- a/src/Entity/AbstractToken.php +++ b/src/Entity/AbstractToken.php @@ -115,7 +115,7 @@ abstract class AbstractToken */ public function setToken($token = null) { - $this->token = ($token !== null) ? $token : SecureKey::make(); + $this->token = ($token !== null) ? $token : SecureKey::generate(); return $this; } diff --git a/src/Grant/AuthCode.php b/src/Grant/AuthCode.php index 39271433..5a2250d0 100644 --- a/src/Grant/AuthCode.php +++ b/src/Grant/AuthCode.php @@ -163,7 +163,7 @@ class AuthCode extends AbstractGrant // Create a new auth code $authCode = new AC($this->server); - $authCode->setToken(SecureKey::make()); + $authCode->setToken(SecureKey::generate()); $authCode->setRedirectUri($authParams['redirect_uri']); foreach ($authParams['scopes'] as $scope) { @@ -250,7 +250,7 @@ class AuthCode extends AbstractGrant // Generate the access token $accessToken = new AccessToken($this->server); - $accessToken->setToken(SecureKey::make()); + $accessToken->setToken(SecureKey::generate()); $accessToken->setExpireTime($this->server->getAccessTokenTTL() + time()); foreach ($authCodeScopes as $authCodeScope) { @@ -267,7 +267,7 @@ class AuthCode extends AbstractGrant // Associate a refresh token if set if ($this->server->hasGrantType('refresh_token')) { $refreshToken = new RefreshToken($this->server); - $refreshToken->setToken(SecureKey::make()); + $refreshToken->setToken(SecureKey::generate()); $refreshToken->setExpireTime($this->server->getGrantType('refresh_token')->getRefreshTokenTTL() + time()); $response['refresh_token'] = $refreshToken->getToken(); } diff --git a/src/Grant/ClientCredentials.php b/src/Grant/ClientCredentials.php index 319530cb..655fafac 100644 --- a/src/Grant/ClientCredentials.php +++ b/src/Grant/ClientCredentials.php @@ -98,7 +98,7 @@ class ClientCredentials extends AbstractGrant // Generate an access token $accessToken = new AccessToken($this->server); - $accessToken->setToken(SecureKey::make()); + $accessToken->setToken(SecureKey::generate()); $accessToken->setExpireTime($this->server->getAccessTokenTTL() + time()); // Associate scopes with the session and access token diff --git a/src/Grant/Password.php b/src/Grant/Password.php index 46bc8160..7dcc083c 100644 --- a/src/Grant/Password.php +++ b/src/Grant/Password.php @@ -146,7 +146,7 @@ class Password extends AbstractGrant // Generate an access token $accessToken = new AccessToken($this->server); - $accessToken->setToken(SecureKey::make()); + $accessToken->setToken(SecureKey::generate()); $accessToken->setExpireTime($this->server->getAccessTokenTTL() + time()); // Associate scopes with the session and access token @@ -165,7 +165,7 @@ class Password extends AbstractGrant // Associate a refresh token if set if ($this->server->hasGrantType('refresh_token')) { $refreshToken = new RT($this->server); - $refreshToken->setToken(SecureKey::make()); + $refreshToken->setToken(SecureKey::generate()); $refreshToken->setExpireTime($this->server->getGrantType('refresh_token')->getRefreshTokenTTL() + time()); $response['refresh_token'] = $refreshToken->getToken(); } diff --git a/src/Grant/RefreshToken.php b/src/Grant/RefreshToken.php index 7fe15632..b1993161 100644 --- a/src/Grant/RefreshToken.php +++ b/src/Grant/RefreshToken.php @@ -136,7 +136,7 @@ class RefreshToken extends AbstractGrant // Generate a new access token and assign it the correct sessions $newAccessToken = new AccessToken($this->server); - $newAccessToken->setToken(SecureKey::make()); + $newAccessToken->setToken(SecureKey::generate()); $newAccessToken->setExpireTime($this->server->getAccessTokenTTL() + time()); $newAccessToken->setSession($session); @@ -160,7 +160,7 @@ class RefreshToken extends AbstractGrant // Generate a new refresh token $newRefreshToken = new RT($this->server); - $newRefreshToken->setToken(SecureKey::make()); + $newRefreshToken->setToken(SecureKey::generate()); $newRefreshToken->setExpireTime($this->getRefreshTokenTTL() + time()); $newRefreshToken->setAccessToken($newAccessToken); $newRefreshToken->save($this->server->getStorage('refresh_token'));