Hi,

I'm trying with no success to update users with Services 7.x-3.19 and Drupal 7.56.

I can login, logout and register but I can't get user information or update it.

I followed this: http://tylerfrankenstein.com/user/4/code/drupal-services-examples

So I introduce X-CSRF-Token and also the Cookie formed by session_name=sessid in headers but I'm always getting: "Access denied for user anonymous"

What am I missing?

Thanks for your help!

j.

Comments

jeepster created an issue. See original summary.

jeepster’s picture

I solved by:

Checking Session authentication in Endpoint edit, adding a token before login and changing it for the returned token with login.
So.

1. Get a token with endpoint/user/token
2. Login with X-CSRF-Token = token in headers: endpoint/user/login.json
3. Change X-CSRF-Token for the new token received after login
4. Get user information with endpoint/user/67.json and X-CSRF-Token in headers
5. Put new user information with endpoint/user/67.json and X-CSRF-Token in headers

No Cookie was needed.

I hope it helps.

tyler.frankenstein’s picture

Status: Active » Closed (works as designed)

Thank you for following up with the solution!