Skip to main content
You may need to add this to your .htaccess file in the parent folder where your WordPress installation is. Once added, restart the server and authentication should work.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]
</IfModule>
Basic authentication is recommended to be used on secure sites that have SSL enabled, so if you attempting to authenticate CoCart without it being secured. Then it will simply fail.
If you are testing on a local or development environment, CoCart will allow you to authenticate via the basic method.
CoCart supports all standard and additional support for identifying ways to login.
  • Username + Password
  • Email + Password
  • Billing Phone Number + Password
How you choose to allow your customers to login is up to you.
Should the customer forget the username they created or what was assigned when registering as a customer, using their email address instead is good alternative.
    curl --request POST \
        --url https://localhost/wp-json/cocart/v2/login \
        --header "Authorization: Basic " + btoa('username:password')
        --header "Content-Type: application/json"
If it is not be possible to authenticate the right way using the headers, you can authenticate the user via URL.
wp-json/cocart/v2/login?username=sebastien@domain.com&password=password
Please keep your sites secure!
I