dotkernel / api

DotKernel's PSR-7 REST style API built around the Mezzio API skeleton.
https://docs.dotkernel.org/api-documentation/
MIT License
35 stars 5 forks source link

authentication config in local.php #112

Closed bidi47 closed 2 years ago

bidi47 commented 2 years ago

after a recent update to an api i got an error detailed below if didn't find if this was covered in previous issues we should also consider updating file config/autoload/local.php.dist in the api basecode

the error TypeError raised in file \api\vendor\mezzio\mezzio-authentication-oauth2\src\ConfigTrait.php line 24: Message: Return value of Mezzio\Authentication\OAuth2\AuthorizationServerFactory::getPrivateKey() must be of the type string, array returned

it's caused by the getPrivateKey() function in mezzio/mezzio-authentication-oauth2 version 2.4.0 that now explicitly requires the return of a string

the fix is to update our config/autoload/local.php from 'private_key' => [ 'key_or_path' => getcwd() . '/data/oauth/private.key', 'key_permissions_check' => false ], to 'private_key' => file_get_contents(getcwd() . '/data/oauth/private.key'),

kakapiciu commented 2 years ago

no need to modify config they just release 2.4.1 with reverting BC break and allowing array structures for private keys, rather than just string

https://github.com/mezzio/mezzio-authentication-oauth2/pull/48

Recomandation: specific require in composer.json mezzio/mezzio-authentication-oauth2 ^2.4.1