github https://github.com/chriskacerguis/codeigniter-restserverから CodeIgniter Rest Server のソース コードをダウンロードしました。
readme ドキュメントに従って統合しましたが、初めて新しいキーを生成するために htttp://www.sitename.com:81/api/key/index のように呼び出すと、403 Forbidden エラーとともに「Invalid API Key」というエラーが表示されますそしてデータベースに保存します。
スクリーンショット 1 : FF ブラウザーで発生したエラーのスクリーンショットと、Google Chrome Windows 7 - 64 ビットで使用される POSTMAN 拡張機能を参照してください。
以下は私のRest.phpのコードです>>>>>
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$config['force_https'] = FALSE;
$config['rest_default_format'] = 'json';
$config['rest_supported_formats'] = ['json','array','csv','html','jsonp','php','serialized','xml'];
$config['rest_status_field_name'] = 'status';
$config['rest_message_field_name'] = 'error';
$config['enable_emulate_request'] = TRUE;
$config['rest_realm'] = 'REST API';
$config['rest_auth'] = FALSE;
$config['auth_source'] = ''; //i set it as none/blank, default value set as 'ldap'
$config['auth_library_class'] = '';
$config['auth_library_function'] = '';
$config['rest_valid_logins'] = ['admin' => '1234'];
$config['rest_ip_whitelist_enabled'] = FALSE;
$config['rest_ip_whitelist'] = '';
$config['rest_ip_blacklist_enabled'] = FALSE;
$config['rest_ip_blacklist'] = '';
$config['rest_database_group'] = 'default';
$config['rest_keys_table'] = 'keys';
$config['rest_enable_keys'] = TRUE; //i set it as TRUE default value is FALSE
$config['rest_key_column'] = 'key';
$config['rest_limits_method'] = 'ROUTED_URL';
$config['rest_key_length'] = 40;
$config['rest_key_name'] = 'X-API-KEY';
$config['rest_enable_logging'] = TRUE;//i set it as TRUE default value is FALSE
$config['rest_logs_table'] = 'logs';
$config['rest_enable_access'] = FALSE;
$config['rest_access_table'] = 'access';
$config['rest_logs_json_params'] = FALSE;
$config['rest_enable_limits'] = FALSE;
$config['rest_limits_table'] = 'limits';
$config['rest_ignore_http_accept'] = FALSE;
$config['rest_ajax_only'] = FALSE;
$config['rest_language'] = 'english';
routes.php のコード >>
$route['api/key/index'] = 'api/key/index'; // Generate First Time Key
CIレストサーバーのこの初回キーを生成する方法を教えてください。
解決策を見つけるために2日から解決しようとしていたが、成功しなかったので、誰かがこの問題の解決策をできるだけ早く提供してくれると本当に助かります。:(