首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >指导我在鼠疫库中实现OAuth2存储类

指导我在鼠疫库中实现OAuth2存储类
EN

Stack Overflow用户
提问于 2015-02-02 06:51:20
回答 1查看 1.3K关注 0票数 1

我正在使用Alex提供的thephpleague库开发一个oAuth 2.0服务器。但是,在初始化授权服务器之后,当我声明存储类时,它会引发以下错误。

“致命错误:未找到类'Storage\SessionStorage‘’”

请帮我解决这个问题。我在这里读到你关于这个问题的文章:- Guide me implementing Oauth2 PHP server using thephpleague library

请告诉我如何实现存储类。我现在的代码是:

代码语言:javascript
复制
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); 
EN

回答 1

Stack Overflow用户

发布于 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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28272443

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档