wp-net / WordPressPCL

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

Cannot retrieve Post content: You are unauthorized to view this page. #189

Closed doraita closed 3 years ago

doraita commented 4 years ago

For some reason the content of each post retrieved reads: "You are unauthorized to view this page" if I try to connect to a hostmonster hosted WordPress instance. The same code works on a local instance that I use for testing.

I have useAuth: true: var posts = await client.Posts.GetAll(embed: false, useAuth: true);

I am able to create posts, delete them, update them but I cannot read the content. Is there any WordPress setting or WordPressPCL parameter that would solve the problem? Am I not authenticated ? Or just not authorized at this time? The JWT token seems to be valid. Some insight on the source or the error message would help. Thanks a bunch.

ThomasPe commented 4 years ago

hey, sorry for the late reply. have you figured out this issue yet? have you tried GetAll without the useAuth-flag? In some cases WordPress doesn't like to receive credentials if they are not required.

ThomasPe commented 3 years ago

I’m closing this issue because it has been inactive for a while. Please feel free to reopen if you still encounter this issue. Thanks!