diff --git a/application/config/rest.php b/application/config/rest.php index f1914a1b3..078d6c097 100644 --- a/application/config/rest.php +++ b/application/config/rest.php @@ -126,7 +126,8 @@ $config['rest_auth'] = 'basic'; | Note: If 'rest_auth' is set to 'session' then change 'auth_source' to the name of the session variable | */ -$config['auth_source'] = 'RestAPISession'; +//$config['auth_source'] = 'RestAPISession'; +$config['auth_source'] = 'library'; /* |-------------------------------------------------------------------------- @@ -301,7 +302,7 @@ $config['rest_keys_table'] = 'ci_apikey'; | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | */ -$config['rest_enable_keys'] = FALSE; +$config['rest_enable_keys'] = TRUE; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/api/v1/APIAuth.php b/application/controllers/api/v1/APIAuth.php index 1d289be79..8253519f8 100644 --- a/application/controllers/api/v1/APIAuth.php +++ b/application/controllers/api/v1/APIAuth.php @@ -10,6 +10,7 @@ * @link http://whisperocity.com/ * @since Version 1.0 * @filesource + * @example curl -H "FHC-API-Key: testapikey@fhcomplete.org" http://localhost/fhcomplete/index.ci.php/api/v1/APIAuth/login?code=aladsfasdf */ // ------------------------------------------------------------------------ @@ -23,7 +24,7 @@ if (! defined('BASEPATH')) /** * Handles user authentication and registration process */ -class AuthAPI extends APIv1_Controller +class APIAuth extends APIv1_Controller { /** * Userauth-Controller constructor. @@ -61,7 +62,7 @@ class AuthAPI extends APIv1_Controller $username = urldecode($this->get('username')); $password = urldecode($this->get('password')); - $account = $this->FHCAuth->auth($username, $password); + $account = $this->fhc_auth->auth($username, $password); // perform login checks if (!$account)