GOAL:
I want my web app to be able to send username and password of a user on my Drupal site, to the Drupal site and have the Drupal site respond with confirmation of whether the user authentication information is correct.
Another need is to have the Drupal server return a session id for a session created, and information for the user, like email, user role, etc.
What I have so far:
I've enabled Services Rest Server, and created an endpoint at www.mysite.com/rest/. I've set the response format to json only, and request parser to application/x-www-form-urlencoded. I've turned on authentication by session, debugging mode. I've also made sure to enable the entire user resource for this endpoint. Navigating to www.mysite.com/rest/user does give me a list of all users.
Regarding my attempts with authentication, I've tried sending requests:
POST www.mysite.com/rest/user/login
Content-Type: application/x-www-form-urlencoded
POST Body:
name:admin,
pass:myadminpassword
But it just keeps returning a 401 Unauthorized response. I've double checked and the auth information is correct. I've tried other variations on parameter names like: (username, password), (user, pass), (name, password), etc.
I can't seem to get the login to work and I've looked through other examples I've found on Stackoverflow but they haven't worked.