【发布时间】:2013-05-23 20:47:37
【问题描述】:
似乎我的 Twitter API 1.1 消费者密钥没有在我的 Amazon EC2 实例 (slightly similar to this question) 上的 CodeIgniter 控制器中被解密,因为
- 我在进行故障排除时收到
unable to authenticate you错误 - 和我的
print_r($settings)语句(见下文)在浏览器中显示消费者密码的不可读取字符,尽管我使用这行'consumer_secret' => $this->encrypt->decode($this->config->item('consumer_secret')对其进行了解密。
my_controller.php
$settings = array(
'oauth_access_token' => $this->config->item('oauth_access_token'),
'oauth_access_token_secret' => $this->config->item('oauth_access_token_secret'),
'consumer_key' => $this->config->item('consumer_key'),
'consumer_secret' => $this->encrypt->decode($this->config->item('consumer_secret'))
);
print_r($settings);
注意:我将 encrypted 消费者密钥保存在 CodeIgniter 的配置目录中,并在 config.php 中设置了我的加密密钥。有趣的是,它在 WAMP 中运行良好,但在 Amazon EC2 中却不行。
我该如何解决这个问题?我应该将未加密的消费者密钥保存在配置文件中吗?
【问题讨论】:
标签: php codeigniter encryption amazon-ec2 twitter