Php 如何为zend expressive使用phly-expressive-OAuth2Client身份验证模块
Hy 我想在我的表达型应用程序中使用这个模块() 我读了这个文档 以下是我所做的: 在我的config/autoload文件夹中,我使用以下数组添加了一个oauth2clientauthentication.global.php:Php 如何为zend expressive使用phly-expressive-OAuth2Client身份验证模块,php,oauth-2.0,mezzio,Php,Oauth 2.0,Mezzio,Hy 我想在我的表达型应用程序中使用这个模块() 我读了这个文档 以下是我所做的: 在我的config/autoload文件夹中,我使用以下数组添加了一个oauth2clientauthentication.global.php: 'oauth2clientauthentication' => [ 'routes' => [ 'production' => '/(:provider)(/oauth2callback)', ], ], 在我的pi
'oauth2clientauthentication' => [
'routes' => [
'production' => '/(:provider)(/oauth2callback)',
],
],
在我的pipeline.php文件中,我添加了
use Phly\Expressive\OAuth2ClientAuthentication\OAuth2CallbackMiddleware;
$app->pipe('/auth', OAuth2CallbackMiddleware::class);
在我的ConfigProvider.php文件中,我添加了一个带有此配置的路由(我使用slim router with:
当我尝试此url:“”时,我使用github按钮获取未经验证的页面。但当我单击该按钮时,url为:“”,并出现错误:
Unable to resolve service "Zend\Expressive\Delegate\NotFoundDelegate"
我不明白问题出在哪里,有人有办法解决这个问题吗?看起来您升级了Expressive安装,但没有经过测试 检查您的
config/autoload/dependencies.global.php
。它应该包含如下内容:
use Zend\Expressive\Container\NotFoundDelegateFactory;
use Zend\Expressive\Delegate\NotFoundDelegate;
return [
'dependencies' => [
'aliases' => [
'Zend\Expressive\Delegate\DefaultDelegate' => NotFoundDelegate::class,
],
'factories' => [
NotFoundDelegate::class => NotFoundDelegateFactory::class,
],
],
];
use Zend\Expressive\Container\NotFoundDelegateFactory;
use Zend\Expressive\Delegate\NotFoundDelegate;
return [
'dependencies' => [
'aliases' => [
'Zend\Expressive\Delegate\DefaultDelegate' => NotFoundDelegate::class,
],
'factories' => [
NotFoundDelegate::class => NotFoundDelegateFactory::class,
],
],
];