• Resolved cleo55

    (@cleo55)


    Hi,
    I am working on one the website which has an SSL https://watsuniq.com/. I also have created the REST customer and private key. I get a return response in postman as follow
    {
    “code”: “woocommerce_rest_cannot_view”,
    “message”: “Sorry, you cannot list resources.”,
    “data”: {
    “status”: 401
    }
    }

    I have already tried updating the htaccess file to this
    #BEGIN WordPress
    <IfModule mod_rewrite.c>
    #METALOCATOR: This line added to allow basic authentication under FastCGI
    SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    #METALOCATOR: This line added to allow basic authentication under FastCGI
    #METALOCATOR: Establishes an environment variable used by the plugin only for URLs beginning with wp-json/
    RewriteRule ^wp-json/.* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
    </IfModule>

    Still don’t luck with the Authentication process.

    For postman I sent the keys through basicauth

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @cleo55!

    Please check whether you’re connecting correctly over https or using http as there are 2x different methods of authentication:

    https://woocommerce.github.io/woocommerce-rest-api-docs/#authentication-over-https

    I would also recommend temporarily switch to another default WordPress theme, like Storefront, to see if the same happens there. If the issue goes away, then you will need to contact your theme author for further help. If the issue remains, then you will need to disable all plugins except for WooCommerce core, to see if that resolves the issue. If it does, you will need to re-enable each plugin on-by-one until it breaks again and then contact the author of the conflicting plugin.

    If you don’t want to make this switch on your live production site, then I would recommend you use a free plugin like https://ww.wp.xz.cn/plugins/wp-staging/ where you can do the test without it impacting your production site.

    You can learn more about conflict testing here:

    https://docs.woocommerce.com/document/how-to-test-for-conflicts/

    Cheers!

    Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Howdy.

    We haven’t heard back from you in a while, so I’m going to go ahead and mark this thread as resolved. If you have any other questions please start a new thread.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Status 401 Error’ is closed to new replies.