You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
401 : Sorry, you are not allowed to create posts as this user #349
I am able to solve this problem. it was some misconfiguration in .htaccess file. I have installed "Application Passwords" plugin which indicated the problem in htaccess file.
No amount of hacking the .htaccess file nor installing this plugin has the correct effect. Whenever I try to upload media with credentials that I know to be correct, I get "Sorry, you are not allowed to create posts as this user". This makes absolutely no sense as the user is me and I'm an admin.
Reacted by viktor.romaniuk, Jamsta1972, Joel Christophel, Manish Muttreja, Csaba, Marko, Yuri, Albert Marashi, Daniel Collier, Victoria Kazeem and 13 more
I am getting the same problem, followed all the steps and its still failing to upload media with credentials that are correct. The error is same as @samdoj and it happens even with admin users.
I am getting the same problem, followed all the steps and its still failing to upload media with credentials that are correct. The error is same as @samdoj and it happens even with admin users.
I spent hours facing the same problem and finally got it to work. The only plugin I installed was Application Passwords. I also edited the .htaccess file per the comments above. The issue I ran into was what username to use for the authorization header. I was trying to use the name assigned to the password generated through Application Passwords. In reality, you should use your actual username, which in my case is just "admin" (along with the password from Application Passwords).
Reacted by Albert Hernández, Failclosed, Jan Ondis, Mikael Finstad, DPW, Takumi Hara, Nikhil Limbad, Rigo De La Torre, Giulio Pons, hssonusoni and 10 more
Reacted by Robin Chalia, Przemek Hernik, Giulio Pons, Damien Chantelouve, Nazmul Islam and justindboland
Reacted by Lucian Hontau, Michael Ott, Albert Hernández, Luke Venter, Jan Ondis, Mikael Finstad, Takumi Hara, Anton Kouliavtsev, Robin Chalia, Wahab Benhaddà and 10 more
I spent hours facing the same problem and finally got it to work. The only plugin I installed was Application Passwords. I also edited the .htaccess file per the comments above. The issue I ran into was what username to use for the authorization header. I was trying to use the name assigned to the password generated through Application Passwords. In reality, you should use your actual username, which in my case is just "admin" (along with the password from Application Passwords).
This is the actual answer here.
Same username, but generated Application Password.
Reacted by Daniel Turuș, Daniel Collier, Sam Holguin, Adrian and Trịnh Huy Nam
For folks that are still having issues even though their rules in .htaccess are correct: Does the username you are using have a space in it (eg: firstName lastName)? If so, create a new user with a username without a space (eg: firstNameLastName). This fixed the issue for me. Remotely connecting from another WordPress site was working fine for me but connecting from Power Automate was NOT until I used a username without a space. Hope this helps!
The problem stemmed from a permissions issue with the WP BASIC Auth plugin, despite using an Administrator account. After adjusting the necessary settings, the error Sorry, you are not allowed to upload this file type no longer occurs.
I spent hours facing the same problem and finally got it to work. The only plugin I installed was Application Passwords. I also edited the .htaccess file per the comments above. The issue I ran into was what username to use for the authorization header. I was trying to use the name assigned to the password generated through Application Passwords. In reality, you should use your actual username, which in my case is just "admin" (along with the password from Application Passwords).
I spent hours facing the same problem and finally got it to work. The only plugin I installed was Application Passwords. I also edited the .htaccess file per the comments above. The issue I ran into was what username to use for the authorization header. I was trying to use the name assigned to the password generated through Application Passwords. In reality, you should use your actual username, which in my case is just "admin" (along with the password from Application Passwords).
I spent hours facing the same problem and finally got it to work. The only plugin I installed was Application Passwords. I also edited the .htaccess file per the comments above. The issue I ran into was what username to use for the authorization header. I was trying to use the name assigned to the password generated through Application Passwords. In reality, you should use your actual username, which in my case is just "admin" (along with the password from Application Passwords).
This worked for me. Use your actual username instead of application password name.
Activity
jangirsuresh95 commentedon Dec 20, 2017
I am able to solve this problem. it was some misconfiguration in .htaccess file. I have installed "Application Passwords" plugin which indicated the problem in htaccess file.
richplastow commentedon Mar 31, 2018
For anyone else who encounters this problem, you need to install and activate the ‘Application Passwords’ plugin and then follow the instructions given here:
https://github.com/georgestephanis/application-passwords/wiki/Basic-Authorization-Header----Missing
But you don’t need to actually set up any Application Passwords for your users.
samdoj commentedon Apr 4, 2018
No amount of hacking the .htaccess file nor installing this plugin has the correct effect. Whenever I try to upload media with credentials that I know to be correct, I get "Sorry, you are not allowed to create posts as this user". This makes absolutely no sense as the user is me and I'm an admin.
ManishMuttreja1 commentedon Mar 29, 2019
I am getting the same problem, followed all the steps and its still failing to upload media with credentials that are correct. The error is same as @samdoj and it happens even with admin users.
emmieandrew commentedon Apr 19, 2019
{
"code": "rest_cannot_create",
"message": "Sorry, you are not allowed to create posts as this user.",
"data": {
"status": 401
}
}
i am unable to solve this issue please help
emmieandrew commentedon Apr 19, 2019
did you solve this ?
mattcullenmeyer commentedon Apr 24, 2019
I spent hours facing the same problem and finally got it to work. The only plugin I installed was Application Passwords. I also edited the .htaccess file per the comments above. The issue I ran into was what username to use for the authorization header. I was trying to use the name assigned to the password generated through Application Passwords. In reality, you should use your actual username, which in my case is just "admin" (along with the password from Application Passwords).
gotofritz commentedon Jun 24, 2019
I have the same issue and I cannot solve it with the free plan on wordpress.com as I cannot install plugins
This is a bug, it should just work and I shouldn't need to install plugins. Thanks
smartm0use commentedon Dec 16, 2019
This does the trick! Thank you.
arunbasillal commentedon Apr 9, 2020
The original suggestion didn't work for me (On Local by Flywheel)
This worked: https://wordpress.stackexchange.com/a/310898/90061
geniecoder commentedon Apr 12, 2020
I was facing the same issue and the problem is, I forgot to add these lines in htaccess file.
RewriteCond %{HTTP:Authorization} ^(.)
RewriteRule ^(.) - [E=HTTP_AUTHORIZATION:%1]
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
You can also check below link to know how and where to add these lines.
https://github.com/imranhsayed/react-with-wordpress/
iDanielBH commentedon Apr 27, 2020
I had a similar problem, and my problem was that it used the "Application Passwords Name" as the username. And the normal username has to be used.
He also doubted whether to use the password with spaces or without spaces, finally it was with spaces.
LukeV111 commentedon Jun 25, 2020
This is the actual answer here.
Same username, but generated Application Password.
kirankumarbiradar commentedon Jun 16, 2023
go to .htaccess file and replace all below text
# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
BabcoxDeveloper commentedon Feb 23, 2024
For folks that are still having issues even though their rules in .htaccess are correct: Does the username you are using have a space in it (eg: firstName lastName)? If so, create a new user with a username without a space (eg: firstNameLastName). This fixed the issue for me. Remotely connecting from another WordPress site was working fine for me but connecting from Power Automate was NOT until I used a username without a space. Hope this helps!
sagar03d commentedon Apr 13, 2024
adjieguntoro-dev commentedon Jun 12, 2024
Thank you...
rimi-web commentedon Jun 28, 2024
The problem stemmed from a permissions issue with the WP BASIC Auth plugin, despite using an Administrator account. After adjusting the necessary settings, the error Sorry, you are not allowed to upload this file type no longer occurs.
shiyouben88 commentedon Aug 28, 2024
We should push this to Top solution!!!
ahmednabik commentedon Jan 9, 2025
You should use Application password instead of your regular user password. For each user, you can create Application password on the user edit page.
exceptionSPG commentedon Sep 1, 2025
This worked for me. Use your actual username instead of application password name.
tobinbc commentedon Sep 13, 2025
I spent waaaay too long on this so I made a PR to update the docs: WP-API/docs#207
mpint commentedon Oct 26, 2025
Others have aluded to it but the username is
some-user, notsome-user@yoursite.com