Title: Rest API Authorization Problem
Last modified: August 2, 2017

---

# Rest API Authorization Problem

 *  [lsantaniello](https://wordpress.org/support/users/lsantaniello/)
 * (@lsantaniello)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/rest-api-authorization-problem/)
 * _[ Moderator note: [moved to Fixing WordPress](https://wordpress.org/support/topic/please-use-how-to-and-troubleshooting-if-you-have-problems-after-installation/).]_
 * Hi guys,
    I need to enable REST API Services for my WP 4.8 but I have problem
   with AUTH.
 *     ```
       GET //wp-json/wp/v2/posts HTTP/1.1
       Host: www.xxxx.it
       Authorization: Basic YWRtaW46cGFzc3dvcmQ=
       ```
   
 * works successfully
 *     ```
       POST /wp-json/wp/v2/posts HTTP/1.1
       Host: www.xxxxxxx.it
       Authorization: Basic YWRtaW46cGFzc3dvcmQ=
       Content-Type: application/json
       {
       	"content": "My content",
       	"title": "My title",
       	"excerpt": "My excerpt"
       }
       doesn't work
   
       I tried to modify the .htacces as read into many forum posts but the problem is not solved.
       ```
   
 * <IfModule mod_rewrite.c>
    RewriteEngine On RewriteBase / RewriteRule ^index\.
   php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}!-
   d RewriteRule . /index.php [L] </IfModule>
 * <IfModule mod_setenvif>
    SetEnvIf Authorization “(.*)” HTTP_AUTHORIZATION=$1 
   </IfModule>`
 * or
 *     ```
       <IfModule mod_rewrite.c>
       RewriteEngine On
   
       RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
   
       RewriteBase /
       RewriteRule ^index\.php$ - [L]
   
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       </IfModule>
       ```
   
 * Could you please help me?
 * Thanks
    -  This topic was modified 8 years, 10 months ago by [lsantaniello](https://wordpress.org/support/users/lsantaniello/).
    -  This topic was modified 8 years, 10 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).

Viewing 1 replies (of 1 total)

 *  Thread Starter [lsantaniello](https://wordpress.org/support/users/lsantaniello/)
 * (@lsantaniello)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/rest-api-authorization-problem/#post-9375014)
 * could you please support me?
 * Tks

Viewing 1 replies (of 1 total)

The topic ‘Rest API Authorization Problem’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [lsantaniello](https://wordpress.org/support/users/lsantaniello/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/rest-api-authorization-problem/#post-9375014)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
