wp-net / WordPressPCL

This is a portable library for consuimg the WordPress REST-API in (almost) any C# application
MIT License
342 stars 130 forks source link

Sorry, you are not allowed to create new terms. #124

Closed ajaybommena closed 6 years ago

ajaybommena commented 6 years ago

I am able to successfully get the token for the credentials provided. However while doing create, update or delete operation I am getting exceptions like if we are tying to create we get Sorry, you are not allowed to create new terms.

I have installed JWT Authentication for WP REST API Using WP Version 4.9.6 Trying in localhost

ThomasPe commented 6 years ago

Can you post the code how you're trying to update a post?

ajaybommena commented 6 years ago

I am just running the unit tests provided. Just want to update you that I have deployed my WP in localhost. I have also done PHP HTTP AUTHORIZATION HEADER ENABLE from .htaccess file and added JWT_AUTH_SECRET_KEY in wp-config.php

I am sure that problem is from local WP could you please help me on this.

ThomasPe commented 6 years ago

Did you enter the credentials of an admin user in the ApiCredentials.cs?

ajaybommena commented 6 years ago

Issue got resolved. Seems like JWT_AUTH_SECRET_KEY in wp-config.php should be same as admin password which I have missed.

ThomasPe commented 6 years ago

That doesn't seem right? You should never add your admin password to any of the php files...

ajaybommena commented 6 years ago

Yes you are so true. I missed this important point. I have changed by used a string from here https://api.wordpress.org/secret-key/1.1/salt/. and Its working now.

Thanks A lot 👍