diff --git a/src/League/OAuth2/Server/Authorization.php b/src/League/OAuth2/Server/Authorization.php index e466ba830..6276211c7 100644 --- a/src/League/OAuth2/Server/Authorization.php +++ b/src/League/OAuth2/Server/Authorization.php @@ -12,7 +12,6 @@ namespace League\OAuth2\Server; use League\OAuth2\Server\Util\Request; -use League\OAuth2\Server\Util\SecureKey; use League\OAuth2\Server\Storage\SessionInterface; use League\OAuth2\Server\Storage\ClientInterface; use League\OAuth2\Server\Storage\ScopeInterface; diff --git a/src/League/OAuth2/Server/Grant/AuthCode.php b/src/League/OAuth2/Server/Grant/AuthCode.php index 6b09a581b..13f383b0f 100644 --- a/src/League/OAuth2/Server/Grant/AuthCode.php +++ b/src/League/OAuth2/Server/Grant/AuthCode.php @@ -14,6 +14,7 @@ use League\OAuth2\Server\Authorization; use League\OAuth2\Server\Exception; use League\OAuth2\Server\Exception\ClientException; +use League\OAuth2\Server\Util\DefaultGenerator; /** * Auth code grant class @@ -149,8 +150,9 @@ public function checkAuthoriseParams($inputParams = array()) */ public function newAuthoriseRequest($type, $typeId, $authParams = array()) { - // Generate an auth code - $authCode = $this->getTokenGenerator()->generate(); + // Generate an auth code. + // We want to use the default generator for this + $authCode = (new DefaultGenerator())->generate(); // Remove any old sessions the user might have $this->authServer->getStorage('session')->deleteSession($authParams['client_id'], $type, $typeId); diff --git a/src/League/OAuth2/Server/Grant/ClientCredentials.php b/src/League/OAuth2/Server/Grant/ClientCredentials.php index 1d0c4c6c7..e005380ad 100644 --- a/src/League/OAuth2/Server/Grant/ClientCredentials.php +++ b/src/League/OAuth2/Server/Grant/ClientCredentials.php @@ -11,13 +11,8 @@ namespace League\OAuth2\Server\Grant; -use League\OAuth2\Server\Request; use League\OAuth2\Server\Authorization; use League\OAuth2\Server\Exception; -use League\OAuth2\Server\Util\SecureKey; -use League\OAuth2\Server\Storage\SessionInterface; -use League\OAuth2\Server\Storage\ClientInterface; -use League\OAuth2\Server\Storage\ScopeInterface; /** * Client credentials grant class diff --git a/src/League/OAuth2/Server/Grant/Password.php b/src/League/OAuth2/Server/Grant/Password.php index 13cb8a60b..10ceb05ad 100644 --- a/src/League/OAuth2/Server/Grant/Password.php +++ b/src/League/OAuth2/Server/Grant/Password.php @@ -11,13 +11,8 @@ namespace League\OAuth2\Server\Grant; -use League\OAuth2\Server\Request; use League\OAuth2\Server\Authorization; use League\OAuth2\Server\Exception; -use League\OAuth2\Server\Util\SecureKey; -use League\OAuth2\Server\Storage\SessionInterface; -use League\OAuth2\Server\Storage\ClientInterface; -use League\OAuth2\Server\Storage\ScopeInterface; /** * Password grant class diff --git a/src/League/OAuth2/Server/Grant/RefreshToken.php b/src/League/OAuth2/Server/Grant/RefreshToken.php index 6ee0d342a..6dc3aa34e 100644 --- a/src/League/OAuth2/Server/Grant/RefreshToken.php +++ b/src/League/OAuth2/Server/Grant/RefreshToken.php @@ -11,13 +11,8 @@ namespace League\OAuth2\Server\Grant; -use League\OAuth2\Server\Request; use League\OAuth2\Server\Authorization; use League\OAuth2\Server\Exception; -use League\OAuth2\Server\Util\SecureKey; -use League\OAuth2\Server\Storage\SessionInterface; -use League\OAuth2\Server\Storage\ClientInterface; -use League\OAuth2\Server\Storage\ScopeInterface; /** * Referesh token grant