/**
  * Authenticate the tenant using the supplied credentials
  * and we will update X-Auth-Token in here.
  * @return null
  */
 public function authenticate()
 {
     //TODO
     /*$client = new Client();
       $client->setURL("http://172.16.4.31:5000/v2.0/tokens");
       $response = $client->post_json($this->getCredentials());
       */
     $identity = IdentityService::factory($this);
     $response = $identity->generateToken($this->getCredentials());
     $body = json_decode($response);
     //echo "access->serviceCatalog:<br/>";
     //print_r($body);
     //echo "<br/>";
     $this->setCatalog($body->access->serviceCatalog);
     $this->setToken($body->access->token->id);
     parent::setHeader("X-Auth-Token", $this->getToken());
     if (isset($body->access->token->tenant)) {
         $this->setTenant($body->access->token->tenant->id);
     }
 }