HTTP digest authentication

This commit is contained in:
paolo
2016-04-13 16:59:51 +02:00
parent d689953b83
commit 64de1ed4f4
3 changed files with 8 additions and 6 deletions
+4 -3
View File
@@ -110,7 +110,7 @@ $config['rest_realm'] = 'FHC REST API';
| authorization key
|
*/
$config['rest_auth'] = 'basic';
$config['rest_auth'] = 'digest';
/*
|--------------------------------------------------------------------------
@@ -145,7 +145,8 @@ $config['auth_source'] = 'library';
|
*/
$config['auth_library_class'] = 'fhcauth';
$config['auth_library_function'] = 'auth';
//$config['auth_library_function'] = 'auth';
$config['auth_library_function'] = 'auth_digest';
/*
|--------------------------------------------------------------------------
@@ -202,7 +203,7 @@ $config['auth_library_function'] = 'auth';
| Array of usernames and passwords for login, if ldap (even library) is configured this is ignored
|
*/
$config['rest_valid_logins'] = ['admin' => '1234', 'test' => 'test'];
//$config['rest_valid_logins'] = ['admin' => '1234', 'test' => 'test'];
/*
|--------------------------------------------------------------------------
+2 -2
View File
@@ -528,7 +528,7 @@ abstract class REST_Controller extends CI_Controller {
{
$this->_allow = $this->_detect_api_key();
}
// Only allow ajax requests
if ($this->input->is_ajax_request() === FALSE && $this->config->item('rest_ajax_only'))
{
@@ -540,7 +540,7 @@ abstract class REST_Controller extends CI_Controller {
}
// When there is no specific override for the current class/method, use the default auth value set in the config
if ($this->auth_override === FALSE && !($this->config->item('rest_enable_keys') && $this->_allow === TRUE))
if ($this->auth_override === FALSE && ($this->config->item('rest_enable_keys') && $this->_allow === TRUE))
{
$rest_auth = strtolower($this->config->item('rest_auth'));
switch ($rest_auth)
+2 -1
View File
@@ -65,7 +65,8 @@ class authentication extends auth
|| $username=='gl2'
|| $username=='lektor1'
|| $username=='lektor2'
|| $username=='lektor3'))
|| $username=='lektor3'
|| $username == 'aufname'))
return true;
else
return false;