Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Athenticated requests return 401 when Wordpress cookies are available #208

Open
mateuswetah opened this issue Jul 7, 2017 · 1 comment

Comments

@mateuswetah
Copy link

I'm using Ionic to implement an App for accessing a Wordpress blog using WP-API and Oauth1.

My work flow for obtaining the tokens went fine and I can confirm that they're valid. The only problem is that, if I try to do any authenticated request (for example, GET to /users/me), I have a status 401 with the code "rest_not_logged_in". It took me a time to figure out that if I had my cookies cleared the problem would be solved. The cookies are related to Wordpress session login, performed during authorize step with the user.

I was able to solve it performing a wp_logout on my calllback URL, but still, it's not pretty... can anyone explain me why this happens?

Thanks in advance.

@muraliwebworld
Copy link

Yes I have also faced same problem it returned 401 while creating post from cordova app. After analyzing i found that the function rest_oauth1_force_reauthentication which issues return when user is already logged on due to which it is not authenticating properly. This plugin needs to be updated so that it will authenticate properly after authorize or as you said it needs to perform logout before other request after authorization to re-authenticate users using token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants