• Hi All, I’m new to wordpress. I’ve installed wordpress with woo commerce on windows 10, using IIS as my webserver. I am in the process of writting an C# WebApi to both consume and send data to wordpress/woo.

    From wordpress if I create a webhook for example on create new order, the data successfully reaches my webapi endpoint. So Now I’m trying to send a new product to Woo using the latest version of WooCommerce.Net. When I try from my Api, I keep receiving an unauthorized 401 error. So thought I’d try using postman and I get the same. Using postman again, if I try a more simple command ‘Get all products’ this also gives unauthorized.

    The user that I created in WordPress is set in there as an Administrator and has read/write access. I also created the same user on windows 10 and then within IIS for the site ensured they also had read/write access to the site directory. I’ve also made sure Basic Authentication is enabled in IIS.

    Using postman I set this to use basic authentication and I supply it with the wordpress username and password. I’ve also ensured the content type is set to application/json. I’ve also tried adding the consumer key to the request header, but still get a 401. Can anyone think of anything else that I can check/do.

    • This topic was modified 3 years, 8 months ago by Jan Dembowski.
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    If you’re getting an unauthorized response, it’s probably not an IIS specific issue, as evidenced by it not working from postman as well. API authentication until recently has been a challenge. The recently introduced application passwords has greatly simplified authentication for the API. I recommend you use this form of authentication.

    Application Passwords: Integration Guide

Viewing 1 replies (of 1 total)
  • The topic ‘how to configure IIS correctly’ is closed to new replies.