_authServer === null) { $authServer = new AuthorizationServer(); $authServer->setAccessTokenStorage(new Storage\AccessTokenStorage()); $authServer->setClientStorage(new Storage\ClientStorage()); $authServer->setScopeStorage(new Storage\ScopeStorage()); $authServer->setSessionStorage(new Storage\SessionStorage()); $authServer->setAuthCodeStorage(new Storage\AuthCodeStorage()); $authServer->setRefreshTokenStorage(new Storage\RefreshTokenStorage()); $authServer->setScopeDelimiter(','); $authServer->setAccessTokenTTL(86400); // 1d $authServer->addGrantType(new Grants\AuthCodeGrant()); $authServer->addGrantType(new Grants\RefreshTokenGrant()); $authServer->addGrantType(new Grants\ClientCredentialsGrant()); $this->_authServer = $authServer; SecureKey::setAlgorithm(new UuidAlgorithm()); } return $this->_authServer; } }