tetsuya40
Forum Replies Created
-
Adding the string “Header always set Access-Control-Allow-Headers: Authorization” in the .htaccess file, now also reads the header! 😀
My .htaccess file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
Header always set Access-Control-Allow-Headers: Authorization
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{HTTP:Authorization} .
RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPressWow! The problem is solved 🙂
i have modified my .htaccess file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{HTTP:Authorization} .
RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPressI have deleted client_id and secret from the Postman Authorization tab,
and i have included into the keys of the body tab.view link:
http://chiptown.it/wp-content/uploads/2016/04/ForJustinGreer.png
Thanks! 😀
Following the link
https://wp-oauth.com/kb/header-authorization-basic-may-not-work-expected/
I should:
… 3.Send client_id and client_secret post as a parameter in the body instead of using Basic Auth.If (Postman) modify the Username and Password fields of the Authorization Tab (Type: Basic Auth), and instead of client_id and secret (client: ‘maradona’) insert username and password (user: ‘maradona’), after ‘send ‘I do not receive the token and gives me the same answer
“Error”: “invalid_client”
“Error_description”: “Client credentials were not found in the headers or body”see link
http://chiptown.it/wp-content/uploads/2016/04/Schermata-2016-04-26-alle-10.20.06.pngI have created a user of WordPress:
name: ‘maradona’ (with permission of the author)
password: ‘GD5xxx’and I included in body (Postman)
grant_type: ‘password’
username: ‘maradona’
password: ‘xxxx’see link
Then I created in OAuth Server> Clients> Add New Clients the client:name: ‘maradona’
client_id: ‘w0PRPx’
secret: ‘rl7xx’and I entered into the Postman Authorization tab:
Username: ‘w0PRPx’
Password: ‘rl7xx’Then I run ‘Update Request’ and created me the key header.
Finally I ran the ‘Send’ to make the POST and responded with the error ‘invalid_client’, error_description: “Clients were not found in the headers or body.”
In the .htaccess file I tried to insert ‘RewriteRule. * – [E = HTTP_AUTHORIZATION:% {HTTP: Authorization}]’ (uncommented) after RewriteBase, then even after RewriteCond and RewriteRule after, but does not work the layout and after I performed the ‘Send’ I have the same error.
Vincenzo
[please do not share credentials. It is very dangerous! ;)]
I tried modifying my .htaccess file but the website does not work:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule . /index.php [L]
</IfModule># END WordPress