It appears that my consumer secret key for Twitter API 1.1 is not being decrypted in my CodeIgniter controller on my Amazon EC2 instance (slightly similar to this question) because
- I got an
unable to authenticate you
error while troubleshooting - and my
print_r($settings)
statement (see below) displays unreadeable characters for the consumer secret in the browser inspite of the fact that I decrypted it with this line'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);
Note: I saved the encrypted consumer secret key in CodeIgniter's configuration directory and also set my encryption key in config.php. Interestingly, it works fine in WAMP but not in Amazon EC2.
How do I resolve this problem? Should I just save the unencrypted consumer secret key in the configuration file?