Log in or register to post comments

Questions for PHP Developers

February 28, 2013 - 2:56am #6

Hi,

We have been through this url in the past (https://developer.vuforia.com/forum/general-discussion/vws-authorization-problem) and have followed VWSSample.zip sample very closely.

I have attached VWSSample with "response queries" as a comment for your perusal with each step debugged (https://www.dropbox.com/s/c3mfaxry5e59xpz/VWSSample.zip)

As suggested in the developers guide (https://developer.vuforia.com/resources/dev-guide/adding-target-cloud-database-api), we have checked the Date used for creating a Signature and Date added in the Header Parameter as well and they are same and we followed the steps given in the Developers guide and used Code snippets provided in the related subject forum links.

We are still getting Authentication Error with PHP only.

Authentication Error occurs when we are Adding Target in the Cloud Database for Post HTTP Requests  (GET everything works fine).  

Kindly Help!

Regards,
Sanj

Questions for PHP Developers

February 27, 2013 - 4:16am #5

Hi Sanj,

you may also want to have a look at this other thread (where quite some PHP code is shared/discussed as well):

https://developer.vuforia.com/forum/general-discussion/vws-authorization-problem

Also, we are considering putting together some PHP samples for VWS, but at the moment we don't have a confirmed timeline for that yet.

 

Questions for PHP Developers

February 27, 2013 - 2:58am #4

Hi,

Any update on this post as we are getting same problem with PHP Code.  Please Help!

Kind Regards,

Sanj

Questions for PHP Developers

February 25, 2013 - 12:18am #3

Any updates regarding the adding of targets in a cloud database using cURL? I am pretty much sure that I have completed all the requirements and yet I always get "AuthenticationFailure". Getting a target works but uploading one doesn't. Thank you very much!

Questions for PHP Developers

February 1, 2013 - 10:43am #2

I using only curl library for remote connection to vuforia server. Source code for signature builder is in my post about vws authorization problem.

 

  public function getData($credentials, $target, $datetime){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $target);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Date: ' .$datetime, 'Authorization: VWS ' .$credentials));
    $json = curl_exec($ch);
    curl_close($ch);
    return $json;
  }
  
  private function postData($credentials, $target, $datetime, $data){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $target);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_POST, TRUE);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Date: ' .$datetime, 'Content-Type: application/json', 'Authorization: VWS ' .$credentials));
    $json = curl_exec($ch);
    curl_close($ch);
    return $json;
  }
  
  private function putData($credentials, $target, $datetime, $data){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $target);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Date: ' .$datetime, 'Content-Type: application/json', 'Authorization: VWS ' .$credentials, 'Content-Type: application/json'));
    $json = curl_exec($ch);
    curl_close($ch);
    return $json;
  } 

Pages

Log in or register to post comments