Basic auth always valid
Hi, I think there is a problem on basic authentication in the version 3.0.0 because it results valid with wrong credentials or without them.
I tried to rollback to version 2.8.0 and all it works correctly.
May you check it please?
Same problem here... basic auth only work for index pages. If I create another public function in the controller, any request goes through
Investigating...
So, the problem is here: https://github.com/chriskacerguis/codeigniter-restserver/blob/master/application/libraries/REST_Controller.php#L828
basically, it needs to add the following 2 lines:
$this->output->_display();
exit;
The problem that I am having is that using exit breaks the unit testing, so I'm trying to rework things so I don't have to use exit.
Ultimately, the issue is with _display() in the CI Output Class
https://codeigniter.com/user_guide/libraries/output.html#CI_Output::_display
Hi,
I'm starting using the restserver, thanks for providing such good tool.
It appears the rest_auth = 'session' method is always validating any request, whether the session exists or not.
While debugging the REST_Controller.php I've found the _check_php_session is actually identifying the lacking of the session and throwing a HTTP_UNAUTHORIZED response, but the process continues and the user method (i.e. "get") always responds as if is validated.
Digest auth, also always valid
I suggest that the REST_Controller will not call the endpoint if authentication failed. Aborting the script execution mid-air might have worse implications than breaking tests...
I found this problem. In the REST_Controller.php function _remap (line 629) $this->response is missing a 'return;' after each unauthorized or forbidden response. The code keeps going to the next section which eventually becomes authorized.
This has been fixed in other pull requests in a much more complicated way.
Fix comes with this commit https://github.com/chriskacerguis/codeigniter-restserver/commit/54b2b9cf0698811f9fdf3a1f833f94295ef7a955
See here https://github.com/chriskacerguis/codeigniter-restserver/issues/790
Closing this, please reopen if you are still having the issues.