We'll create fresh WordPress site with CoCart – JWT Authentication installed. You have 20 minutes to test the plugin after that site we'll be deleted.
This free add-on for CoCart allows you to authenticate via a simple JWT Token.
★★★★★
An excellent plugin, which makes building a headless WooCommerce experience a breeze. Easy to use, nearly zero setup time. Harald Schneider
Most shared hosts have disabled the HTTP Authorization Header by default.
To enable this option you’ll need to edit your .htaccess file by adding the following:
RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]
or
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
To enable this option you’ll need to edit your .htaccess file by adding the following (see this issue):
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
wp-config.php
file defined to COCART_JWT_AUTH_SECRET_KEY
.By default, the token expires after two full days but can be filtered to change to your preference using this hook cocart_jwt_auth_expire
.
Here is an example changing it to expire after just 2 hours.
add_filter( 'cocart_jwt_auth_expire', function() {
return MINUTE_IN_SECONDS * 120
});
jwt_token
in your application.Bearer
authentication with the token given.★★★★★
Amazing Plugin. I’m using it to create a react-native app with WooCommerce as back-end. This plugin is a life-saver! Daniel Loureiro
We also have other add-ons that extend CoCart to enhance your development and your customers shopping experience.
They work with the FREE version of CoCart already, and these add-ons of course come with support too.
A Discord community for developers, WordPress agencies and shop owners building the fastest and best headless WooCommerce stores with CoCart.
Bug reports for CoCart – JWT Authentication are welcomed in the CoCart – JWT Authentication repository on GitHub. Please note that GitHub is not a support forum, and that issues that aren’t properly qualified as bugs will be closed.
This plugin is created by Sébastien Dumont.