ezralazuardy / heimdall

Painless OAuth 2.0 Server for CodeIgniter 4 🔥
https://heimdall.lazuardy.tech
MIT License
41 stars 10 forks source link

Bugfixes & 1 Enhancement #6

Closed klAvAx closed 3 years ago

klAvAx commented 3 years ago

Using PHP 7.4.12 And CodeIgniter 4.1.1 2 Functionality breaking errors: FIX For "Declaration of Heimdall\Http\Headers::normalizeKey($key) must be compatible with Heimdall\Interfaces\Http\HeadersInterface::normalizeKey($key)" Error FIX For "Return value of Heimdall\Server\HeimdallAuthorizationServer::return() must be an instance of CodeIgniter\HTTP\Response, none returned" Error

Did follow execution order as best i could but it seems current resource server implementation only validates token, it should return or pass some data to main controller, currently (CI 4.1.1) viable through request header data or global data. By phpleague's docs 'resource server' should return some header attributes but it looks like codeigniter does not support that and is using PSR4, maybe this workaround is not good but i believe it is one of essential functions of this library. ENHANCEMENT "If the access token is valid then attributes as per phpleague's oauth2 docs will be accessible via $this->request->header('authorization')->getValue()"

ergec commented 3 years ago

Thanks a lot. These fixes solved the problems with my PHP 7.4.16 installation.

codeclimate[bot] commented 3 years ago

Code Climate has analyzed commit e8a01dd8 and detected 0 issues on this pull request.

View more on Code Climate.

ezralazuardy commented 3 years ago

sorry for the late response.., anyway, thanks for your contribution 😀