Famke Posted October 19, 2020 Share Posted October 19, 2020 Hi I added a key to my webservice page to link my accountancy program. The connection doesn't work & when I try to visit my API page https://eco-tronic.eu/api I get error 401 unauthorized. I read a lot online but haven't found any solution. Is there anyone who know's what the problem may be? In the webservice page is my CGI turned to false because when I don't, I can't visit any page... I added my .htaccess file as well. .htaccess Link to comment Share on other sites More sharing options...
Famke Posted October 20, 2020 Author Share Posted October 20, 2020 Anyone? 🙈 Link to comment Share on other sites More sharing options...
pimpyourbottle2 Posted October 20, 2020 Share Posted October 20, 2020 Got the same problem as you. If I connect to <myURL>/api/ the browser promts for username and password. When I enter the authentication key as username (as the documentation https://devdocs.prestashop.com/1.7/webservice/tutorials/testing-access/ says) the browser promts again and again. In the documentations they say, that this happens only if your connection authentication key hasn't set any rights, but I set every right for this test. Is there anyone who knows that problem? Link to comment Share on other sites More sharing options...
Famke Posted October 21, 2020 Author Share Posted October 21, 2020 Found a solution! added this in my htaccess: <IfModule mod_rewrite.c> RewriteEngine on RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] </IfModule> Link to comment Share on other sites More sharing options...
pimpyourbottle2 Posted October 21, 2020 Share Posted October 21, 2020 Thanks for sharing. Actually my problem isn't solved with this. Still if I connect to <myURL>/api/ in a browser I get promted for username and password indefinitely. In the attachment you can see my .htaccess file. Can anybody help me with this problem? .htaccess Link to comment Share on other sites More sharing options...
Famke Posted October 21, 2020 Author Share Posted October 21, 2020 You have to enter the API key as username, no password. Link to comment Share on other sites More sharing options...
pimpyourbottle2 Posted October 21, 2020 Share Posted October 21, 2020 That's exactly what I do. The browser prompts, I enter the API Authentication Key as username and press enter/login. After that, the Login Window closes and opens again. I'm not able to log in. I gave the API key that I'm using at the moment every right existing just for the test but it still does not work. Link to comment Share on other sites More sharing options...
Jurist Posted June 10, 2021 Share Posted June 10, 2021 (edited) I have exactly the same problem, prestashop 1.7.6 Did you manage to fix it @pimpyourbottle2? Edited June 10, 2021 by Jurist (see edit history) Link to comment Share on other sites More sharing options...
redcom10 Posted May 5, 2023 Share Posted May 5, 2023 Thank you I have created the .htaccess at the webservice folder an now it's ok. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now