0

I'm having a problem with regards to Codeigniter Restful authentication. Without the authentication, it works fine. But then when I set the authentication to either "basic" or "digest", response returned is NULL.

I have two(2) codeigniter setup. One is only for the API's and the second is for the web application itself. Here's a snippet of my code.

on the rest.php of the API installation:

$config['rest_auth'] = 'digest';
$config['rest_valid_logins'] = array('admin' => '1234');

on the model of the Web Application installation:

$apiUrl = 'http://localhost/api/blog/posts';
$config = array('server' => $apiUrl,
    'http_user'       => 'admin',
    'http_pass'       => '1234',
    'http_auth'       => 'digest'
);
$this->rest->initialize($config);
$data = $this->rest->get($apiUrl, $args');

Thanks!

basagabi
  • 4,900
  • 6
  • 38
  • 84
  • First things First. I think it is not a very good idea to use 2 codeIgniter Setups in this scenario. You are already making ur work difficult. You could have setup only one setup with service folder in the same project – Talha Masood Jan 02 '14 at 08:35
  • Hi, @TalhaMasood. Thank you for the response. I did a 2 setup to segregate the API from the web application. All of the API application will be put in the API setup and all of the web application will be put in the web application setup. This is because I am running a multi-site for each setup. So each setup has different projects running under their specific setup. API setup has multiple projects as well as the web application. – basagabi Jan 02 '14 at 15:57

0 Answers0