I'm using node-cloudfiles for authenticating.
var cloudfiles = require('cloudfiles');
var config = {
auth : {
username: 'my-username',
apiKey: 'my-api-key'
}
};
var client = cloudfiles.createClient(config);
console.log(client);
And this is what I'm getting
{ config:
{ auth:
{ username: 'my-username',
apiKey: 'my-api-key',
host: 'auth.api.rackspacecloud.com' },
servicenet: false },
authorized: false }
The username and apiKey are right, it works in php, but not in node.js
authorized: false
- where can be the problem?
This fails because the 'cloudfiles' npm module is deprecated. Here's the official GitHub page saying as much: https://github.com/nodejitsu/node-cloudfiles
It's using an old form of authentication as well, and trying to authenticate against a bad URL. I tried changing it to a correct URL, but it still didn't work.
I suggest you use pkgcloud instead, which is what this module has been replaced by. Rackspace developers contribute directly to this package, so it should be much more up to date than what you're trying to use.