question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

401 : Sorry, you are not allowed to create posts as this user

See original GitHub issue

I have tried the same thing mentioned in it and I am getting below error message.

the account I am using is the Administrator and I have WP BASIC Auth (https://github.com/wokamoto/wp-basic-auth) plugin installed.

{
    "data": {
        "code": "rest_cannot_create",
        "message": "Sorry, you are not allowed to create posts as this user.",
        "data": {
            "status": 401
        }
    },
    "headers": {
        "Allow": "GET"
    },
    "status": 401
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13

github_iconTop GitHub Comments

13reactions
mattcullenmeyercommented, 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).

10reactions
samdojcommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating a Post , via REST API: 401 Sorry, you are not allowed ...
The error message relates to creating taxonomy terms, not creating posts. It seems like you may be including new taxonomy term data with...
Read more >
Sorry, you are not allowed to create posts as this user using ...
i have added the following code to htaccess and add plugin (JSON Basic Authentication) then it start working.
Read more >
How to Fix "Sorry, You Are Not Allowed to Access This Page"
Restoring a backup in MyKinsta ; Disable all plugins by renaming the folder.
Read more >
Getting 401 (access denied) when trying to use the REST API
It looks like it's accepting your credentials but failing a permission check for the post specifically. The check is here: github.com/WordPress/ ...
Read more >
Error 401: Sorry You Are Not Allowed To Create Resources
This error will appear when a Scheduled Order fails to process. What This Error Means. This error means that the Wordpress Admin user...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found