Title: Cannot Authenticate
Last modified: October 13, 2020

---

# Cannot Authenticate

 *  Resolved [sitemba](https://wordpress.org/support/users/sitemba/)
 * (@sitemba)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/cannot-authenticate-7/)
 * I’m trying to authenticate with both basic auth and jwt and none seem to be working.

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

 *  [edbatbaz81](https://wordpress.org/support/users/edbatbaz81/)
 * (@edbatbaz81)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/cannot-authenticate-7/#post-13530882)
 * Same here, I have followed the steps and I do retrieve a token:
 * {
    “token”: “eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvcG9ycGhhLmNvbSIsImlhdCI6MTYwMjYzNzk4NCwibmJmIjoxNjAyNjM3OTg0LCJleHAiOjE2MDMyNDI3ODQsImRhdGEiOnsidXNlciI6eyJpZCI6IjMifX19.
   yNErmjwVxBc2vnFyUHaDiZH_X_YIozcJTgPCJZqMnjQ”, “user_email”: “mail@mail.com”, “
   user_nicename”: “bats”, “user_display_name”: “bats”, “roles”: [ “administrator”],“
   store_name”: “bazaldua”, “store_id”: 3 }
 * Then I try to do a simple GET of [https://site.com/wp-json/wcfmmp/v1/products](https://site.com/wp-json/wcfmmp/v1/products)
   and it returns 401.
 *  Plugin Author [WC Lovers](https://wordpress.org/support/users/wclovers/)
 * (@wclovers)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/cannot-authenticate-7/#post-13531472)
 * Hello,
    To use the authentication basic or JWT auth you must use one of the plugins
   recommended by WP for the purpose. [https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/#authentication-plugins](https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/#authentication-plugins)
 * To be more specific Fore Basic auth use the plugin: [https://github.com/WP-API/Basic-Auth](https://github.com/WP-API/Basic-Auth)
   
   And for JWT auth use the plugin: [https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/](https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/)
 * WordPress by default doesn’t support authentication via rest API. You must use
   the plugins recommended by WP. For more details find the guide to do the authentication
   in the plugins details page. Our apps are working fine with JWT auth plugin so
   please follow the guide mentioned in the plugin.
 * [@edbatbaz81](https://wordpress.org/support/users/edbatbaz81/) after getting 
   the token please send the token in the request headers while making GET, POST,
   PUT requests. The authentication method should be Bearer Token in the header 
   while sending the token.
 *  [edbatbaz81](https://wordpress.org/support/users/edbatbaz81/)
 * (@edbatbaz81)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/cannot-authenticate-7/#post-13534393)
 * Thanks for your response, I do use the one that you recommended in the pages 
   mentioned, it just simply doesn’t work.
    I opened a ticket with my hosting provider
   and they tell me that everything is ok. I think a wider documentation or better
   examples could give a hand in to this.
 *  Thread Starter [sitemba](https://wordpress.org/support/users/sitemba/)
 * (@sitemba)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/cannot-authenticate-7/#post-13534578)
 * [@edbatbaz81](https://wordpress.org/support/users/edbatbaz81/) Mine didn’t work
   either even after adding the bearer token to the request. On further inspection,
   I found that the problem was in my .htaccess file. Try changing yours to this:
 * # BEGIN WordPress
    <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule
   ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}!-
   d RewriteRule . /index.php [L] RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule
   ^(.*) – [E=HTTP_AUTHORIZATION:%1] </IfModule> SetEnvIf Authorization “(.*)” HTTP_AUTHORIZATION
   =$1 # END WordPress

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

The topic ‘Cannot Authenticate’ is closed to new replies.

 * ![](https://ps.w.org/wcfm-marketplace-rest-api/assets/icon-256x256.png?rev=2067609)
 * [WCFM - Multivendor Marketplace REST API for WooCommerce](https://wordpress.org/plugins/wcfm-marketplace-rest-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wcfm-marketplace-rest-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wcfm-marketplace-rest-api/)
 * [Active Topics](https://wordpress.org/support/plugin/wcfm-marketplace-rest-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wcfm-marketplace-rest-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wcfm-marketplace-rest-api/reviews/)

## Tags

 * [authentication](https://wordpress.org/support/topic-tag/authentication/)

 * 4 replies
 * 3 participants
 * Last reply from: [sitemba](https://wordpress.org/support/users/sitemba/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/cannot-authenticate-7/#post-13534578)
 * Status: resolved