Title: Basic Auth Not Working
Last modified: January 24, 2017

---

# Basic Auth Not Working

 *  [zuchowra](https://wordpress.org/support/users/zuchowra/)
 * (@zuchowra)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/basic-auth-not-working/)
 * Hey Everyone,
 *  Im running WP-REST API V2 and Basic Auth plugin and this is the error message
   i get.
 * {“code”:”rest_cannot_edit”,”message”:”Sorry, you are not allowed to edit this
   post.”,”data”:{“status”:401}}
 * Any help would be greatly appreciated.
 * I saw this was a known issue and some tinkering on the .htaccess file solved 
   this. I tried it and still didnt work. Maybe i didnt do it right , but look forward
   to your responses. Thanks

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

 *  [jfalcone](https://wordpress.org/support/users/jfalcone/)
 * (@jfalcone)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/basic-auth-not-working/#post-8702519)
 * Having same problem… Basic Auth with V2 API was working fine until 4.7.1 upgrade(
   I think). Unfortunately I can’t revert since we’re on a managed WP site.
 *  [jfalcone](https://wordpress.org/support/users/jfalcone/)
 * (@jfalcone)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/basic-auth-not-working/#post-8702693)
 * First problem is that the filter hook has changed name from json_authentication_errors
   to rest_authentication_errors for the built-in REST API in 4.7.+. That didn’t
   solve it but its the first step
 *  [jfalcone](https://wordpress.org/support/users/jfalcone/)
 * (@jfalcone)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/basic-auth-not-working/#post-8702958)
 * I’ve hot wired authentication and still I’m getting 403 errors so either something
   in 4.7.1 broke the API or GoDaddy has blocked the API in their Managed WordPress
   offering.
 * Have deleted the old WP API V2 plugin, disabled and enabled the built-in API,
   etc. Setting up a case with GoDaddy as well.
 * Rather annoying to say the least since this has taken two of our apps down hard.
 *  [edubvenice](https://wordpress.org/support/users/edubvenice/)
 * (@edubvenice)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/basic-auth-not-working/#post-8703221)
 * Just got off the phone with GoDaddy. They indicate they did not see anything 
   on their end wrt server changes. We’re trying to hit a different non-godaddy 
   hosted WP site to see if its in the WP API or actually something on the GoDaddy
   end.
 *  [jfalcone](https://wordpress.org/support/users/jfalcone/)
 * (@jfalcone)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/basic-auth-not-working/#post-8703749)
 * WP 4.7.2 just came out – maybe it fixes this problem? Although I doubt it.
 *  [jfalcone](https://wordpress.org/support/users/jfalcone/)
 * (@jfalcone)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/basic-auth-not-working/#post-8704385)
 * It’s either a GoDaddy problem or it is fixed by 4.7.2
 * Just tested the WP REST API on a WP 4.7.2 system on Lunarpages and no problems
   running simple endpoints. Sounds like GoDaddy is blocking access to the API.
 *  [pcfjojo](https://wordpress.org/support/users/pcfjojo/)
 * (@pcfjojo)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/basic-auth-not-working/#post-8798594)
 * I also have the same issue, I can get result go “GET” request using postman. 
   When i try to make “POST” request, I get the following error.
 *     ```
       {
         "code": "rest_cannot_delete",
         "message": "Sorry, you are not allowed to delete this post.",
         "data": {
           "status": 401
         }
       }
       ```
   
 * After i did googling, I have got more suggestion specially to make changes on.
   htaccess file as follow.
 *     ```
       RewriteEngine On
       RewriteBase /speedy/
       SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
       RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
       RewriteRule ^index\.php$ - [L]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /speedy/index.php [L]
       ```
   
 * “speedy” is my folder name for wordpress installation.
    Anyone can help me? I
   am using postman with Basic Auth with Authorization header.
 *  [pcfjojo](https://wordpress.org/support/users/pcfjojo/)
 * (@pcfjojo)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/basic-auth-not-working/#post-8798608)
 * I also have the same problem , please let me know if you have found the solutions.
 *  [alainv](https://wordpress.org/support/users/alainv/)
 * (@alainv)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/basic-auth-not-working/#post-9369573)
 * same issue here
 *     ```
       {
         "code": "rest_cannot_edit",
         "message": "Sorry, you are not allowed to delete this post.",
         "data": {
           "status": 401
         }
       }
       ```
   
 * but i can do GET requests.
 *  [andersheie](https://wordpress.org/support/users/andersheie/)
 * (@andersheie)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/basic-auth-not-working/#post-9474774)
 * My problem was the same, and I did find a solution that may help others.
 * First, I was able to successfully and repeatedly GET a list of posts, and also
   GET a specific post in VIEW and EMBED context mode while debugging. I was NOT
   able to get the very same post in EDIT more, but as pointed out here I got a 
   rest_cannot_edit error. This led me to believe there was a problem, since obviously
   the authentication code worked for the other calls.
 * As it turns out, once I refreshed my authentication code, it worked. I know the
   original authentication code was expired, but it still worked for the VIEW and
   EMBED, just not for the EDIT context. Maybe that is the real problem here as 
   I would have expected it to not work at all. Or perhaps because I’m using Cloudflare,
   those calls were cached from earlier tests. I’m not sure. But IF you see this
   problem while testing, it’s worth trying to get a new authentication code and
   just try again.
 * (And of course make sure the user that got the authorization has the correct 
   rights)
    -  This reply was modified 8 years, 8 months ago by [andersheie](https://wordpress.org/support/users/andersheie/).

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

The topic ‘Basic Auth Not Working’ is closed to new replies.

 * ![](https://ps.w.org/rest-api/assets/icon-256x256.png?rev=1346297)
 * [WordPress REST API (Version 2)](https://wordpress.org/plugins/rest-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/rest-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/rest-api/)
 * [Active Topics](https://wordpress.org/support/plugin/rest-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rest-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rest-api/reviews/)

## Tags

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

 * 10 replies
 * 6 participants
 * Last reply from: [andersheie](https://wordpress.org/support/users/andersheie/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/basic-auth-not-working/#post-9474774)
 * Status: not resolved