It does not support auth token. Here were the changes that I added. REST_Controller.php search for "switch ($ rest_auth) {" add add this case to it:
case 'token':
$this->_check_token();
break;
Then add this function:
protected function _check_token () {
if (!empty($this->_args[$this->config->item('rest_token_name')])
&& $row = $this->rest->db->where('token', $this->_args[$this->config->item('rest_token_name')])->get($this->config->item('rest_tokens_table'))->row()) {
$this->api_token = $row;
} else {
$this->response([
$this->config->item('rest_status_field_name') => FALSE,
$this->config->item('rest_message_field_name') => $this->lang->line('text_rest_unauthorized')
], self::HTTP_UNAUTHORIZED);
}
}
config / rest.php
$config['rest_token_name'] = 'X-Auth-Token';
$config['rest_tokens_table'] = 'api_tokens';
source
share