Composer install zend-expressive-authentication-oauth2 does not inject config provider to config.php

Hi,

it looks like running:

composer require zendframework/zend-expressive-authentication-oauth2

does not inject the config provider for zend-expressive-authentication-oauth2. Only the config for \Zend\Expressive\Authentication is added.

I am pretty new to Zend Expressive and I am not an composer expert either but I found this why I was compering source codes of my app to GitHub - ezimuel/zend-expressive-api: Web API skeleton using zend-expressive.

And the only difference is I am missing this line

\Zend\Expressive\Authentication\OAuth2\ConfigProvider::class

in my config.php.

If I add it manually all starts to work. Without it I get error:

“Too few arguments to function Zend\Expressive\Authentication\OAuth2\TokenEndpointHandler::__construct(), 0 passed in C:\xampp\htdocs\rkokno.cz\portal-api\vendor\zendframework\zend-expressive\src\MiddlewareContainer.php on line 64 and exactly 2 expected”

Is there any chance I am doing something wrong? I guess it is not meant to update the config.php manually, right?

Thanks

@stark you are completely right, it is not registered automatically. I’ll create PR to fix it soon and release the it asap. Thanks for reporting.

Please see my PR: https://github.com/zendframework/zend-expressive-authentication-oauth2/pull/63

Sweet, thanks a lot for this quick action :slight_smile: The PR looks good to me.

@stark - v1.2.0 released.

1 Like