30knees Posted April 9 Posted April 9 I am trying to connect a webservice to domain/api and get a 401 error. Using Insomnia, I see this reply: < HTTP/2 401 < server: nginx < date: Tue, 09 Apr 2024 12:53:23 GMT < content-type: text/html; charset=utf-8 < www-authenticate: Basic realm="Welcome to PrestaShop Webservice, please enter the authentication key as the login. No password required." Does anybody have an idea would the problem could be? When I try connecting via the browser https://www.domain.com/api?Authorization=KEY I get the pop up asking for username and password. I enter they key as username and no password and the pop up keeps asking.
datakick Posted April 9 Posted April 9 Webservice can use different types of authentication. By default, basic http authentication is used. But you can use ws_key parameter as well, simply pass it in the url: https://www.domain.com/api?ws_key=KEY
30knees Posted April 9 Author Posted April 9 Thanks. ws_key works in the browser but the third party still isn't working. I'll trouble their support some more and if that doesn't work I'll submit a ticket with you.
30knees Posted April 9 Author Posted April 9 p.s. Are there any changes in the webservice between tb and PS 1.6 that might cause the problem in the third party's implementation?
30knees Posted April 10 Author Posted April 10 The solution was to enable CGIPassAuth On in the .htaccess.
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