codeigniter-restserver icon indicating copy to clipboard operation
codeigniter-restserver copied to clipboard

Digest auth always valid

Open asystat opened this issue 9 years ago • 4 comments

The same as with basic auth...but basic auth was solved with two lines of code 👍 Is there a workaround this? Could you at lease point out where we should look into?

thanks

asystat avatar Feb 07 '17 14:02 asystat

There's a bug in REST_Controller, fixed with this PR: https://github.com/chriskacerguis/codeigniter-restserver/pull/759

Until this is merged I created a workaround using a wrapper function for "response" that checks for authorization. I placed it in my base_controller (inherits REST_Controller).

	public function do_response( $data = null, $http_code = null ) {
		if ( $this->_allow && $this->has_permission ) {
			parent::response( $data, $http_code );
		}
	}

benyaminshoham avatar Feb 07 '17 14:02 benyaminshoham

Hi benyamin, thanks for your help but I tried your PR and it didn't work...it gives me the following error (and more) A PHP Error was encountered Severity: Notice Message: Undefined index: username Filename: libraries/REST_Controller.php Line Number: 2040

asystat avatar Feb 07 '17 15:02 asystat

Same error: A PHP Error was encountered Severity: Notice Message: Undefined index: username Filename: libraries/REST_Controller.php Line Number: 2049

A PHP Error was encountered Severity: Notice Message: Undefined index: qop Filename: libraries/REST_Controller.php Line Number: 2056

A PHP Error was encountered Severity: Notice Message: Undefined index: response Filename: libraries/REST_Controller.php Line Number: 2059

[{"id":1,"name":"John","email":"[email protected]","fact":"Loves coding"},{"id":2,"name":"Jim","email":"[email protected]","fact":"Developed on CodeIgniter"},{"id":3,"name":"Jane","email":"[email protected]","fact":"Lives in the USA","0":{"hobbies":["guitar","cycling"]}}]

jlrdz1 avatar Apr 09 '17 22:04 jlrdz1

See here https://github.com/chriskacerguis/codeigniter-restserver/issues/790

Closing this, please reopen if you are still having the issues.

chriskacerguis avatar Apr 16 '17 21:04 chriskacerguis