use JSON API Auth plugin for getting the valid cookie. You can’t really login for REST protocol your session being the stateless. You will need to provide the cookie variable with each RESTful request you make and check it inside your controller method.
http://your-domain/api/controller_name/method_name/?cookie=John|YGWWdwificwcu398y387rckjciew
I am always having —- HTTP Error 404.0 – Not Found —- error
Could not find the endpoints and its path structure ? (there is not any api folder neither controller_name in my case).They are not working as declared in the document.
For example:
mydomain.com/?json=get_nonce&controller=auth&method=generate_auth_cookie is working well
Then I tried to guess the login() but none of the combination is worked so far
I am checking the api tests by using the following side http://hackst.com/
Could you give a hand to find out what is the exact url of the login method and how can I test it on simple browser ?
You have not enabled the Settings > Permalinks yet.
Alternatively, you can reach the endpoint using
mydomain.com/?json=auth.generate_auth_cookie
or if using JSON API User plugin,
mydomain.com/?json=user.generate_auth_cookie
in the url above, ‘auth’ is controller and ‘generate_auth_cookie’ is method.
mydomain.com/?json=[controller].[method]
BTW, since last update, you don’t need nonce value to generate_auth_cookie anymore.