I get “Sorry, you are not allowed to create new users.” in service call by jwt
-
Hello, I installed and config JWT Authentication plugin and I could call both endpoints of:
/wp-json/jwt-auth/v1/token | POST
/wp-json/jwt-auth/v1/token/validate | POST
I can get token from first endpoint and validate it by second endpoint but when I add that token to service calls WP return 401 error with “Sorry, you are not allowed to create new users.” message.
I called “Add user” service with following URL, header and body:POST https://localhost/wordpress/wp-json/wp/v2/users Header: { "Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sb2NhbGhvc3RcL3dvcmRwcmVzcyIsImlhdCI6MTU0NDAxMzIwOCwibmJmIjoxNTQ0MDEzMjA4LCJleHAiOjE1NDQ2MTgwMDgsImRhdGEiOnsidXNlciI6eyJpZCI6IjEifX19.1P_Pp26zaTQoz2DAiSolgJ52BfABIPoIY4pFGDMwHeM" } Body: { "username": "mytest", "email": "[email protected]", "password": "mytest" }
response:
{ "code": "rest_cannot_create_user", "message": "Sorry, you are not allowed to create new users.", "data":{ "status": 401 }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘I get “Sorry, you are not allowed to create new users.” in service call by jwt’ is closed to new replies.