Jump to content

Prestashop 1.6 webservice authentification on ovh


Recommended Posts

Hello,

 

i have a problem on a prestashop 1.6 and on a OVH mutualise server

I want to acces th webservice api on navigators but authentification loop and doesn't work

 

it always ask me the password,

 

it works on other server or hoster, like on PHPNET and LWS but not on OVH

 

The $_SERVER['PHP_AUTH_USER'] and $_SERVER['HTTP_AUTHORIZATION'] are always empty

 

FCGI is activated, with PHP 5.4

 

the conf of prestashop webservice is good

 

Any Idea ?

 

thank you

 

Best Regards

Link to comment
Share on other sites

i have solved my problem!

 

Create an htaccess in webservice folder with (créer un fichier .htaccess dans le dossier webservice) :

 

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
</IfModule>

 

and in webservice/dispatcher.php add (dans webservice/dispatcher.php ajouter) :

 

if(strpos(@php_sapi_name(), 'CGI')){
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':' , base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6)));
};

 

 

Good luck!

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...