0

I am currently using php could files as API for swift on a SAIO install with tempauth . Executing the php file:

 require('cloudfiles.php');
 $username="test:teste";
 $api_key="AUTH_tkfec9a726c0584d3d8f0150eb36446fd4";
 $auth = new CF_Authentication($username, $api_key);
 $auth->authenticate();
 if ( $auth->authenticated() )
     echo "CF Authentication successful \n";
 else
     echo "Authentication faile \n";

the execution didnt work because some authentication problem:

PHP Fatal error: Uncaught exception 'AuthenticationException' with message 'Invalid username or access key.

The user name and the api_key are corrects (tested with swift command and I could make operation on containers on swift ? I am wondering how it works when authenticating ? any idea

Nikola K.
  • 7,093
  • 13
  • 31
  • 39
Mas
  • 111
  • 1
  • 3
  • 7

1 Answers1

1

You don't give an auth host URL so the default will be https://auth.api.rackspace.com. This might be the problem.

Btw. you should wrap the function in an try-catch block.

echo "Authentication faile \n";

will never be called because authenticate() always returns true if it does not throw an exception.

biegleux
  • 13,179
  • 11
  • 45
  • 52
Karsten
  • 882
  • 6
  • 18