我正在使用Alex提供的thephpleague库开发一个oAuth 2.0服务器。但是,在初始化授权服务器之后,当我声明存储类时,它会引发以下错误。
“致命错误:未找到类'Storage\SessionStorage‘’”
请帮我解决这个问题。我在这里读到你关于这个问题的文章:- Guide me implementing Oauth2 PHP server using thephpleague library
请告诉我如何实现存储类。我现在的代码是:
require_once "/../vendor/autoload.php";
$server = new \League\OAuth2\Server\AuthorizationServer;
$server->setSessionStorage(new Storage\SessionStorage);
$server->setAccessTokenStorage(new Storage\AccessTokenStorage);
$server->setClientStorage(new Storage\ClientStorage);
$server->setScopeStorage(new Storage\ScopeStorage);
$server->setAuthCodeStorage(new Storage\AuthCodeStorage);
$authCodeGrant = new \League\OAuth2\Server\Grant\AuthCodeGrant();
$server->addGrantType($authCodeGrant); 发布于 2015-02-02 07:34:13
您使用的库需要实现您自己的存储类,请参阅http://oauth2.thephpleague.com/implementing-storage-interfaces/。您使用的类名来自一个示例实现https://github.com/thephpleague/oauth2-server/tree/master/examples/relational/Storage,它使用Capsule作为其存储后端。如果您想将Capsule用作后端,则需要下载这些示例实现类并安装https://github.com/illuminate/database。
https://stackoverflow.com/questions/28272443
复制相似问题