User register and login test I am trying to register and log in users via the Services module 7.0-3.11 on Drupal 7.36. 

The endpoints are declared from the following code.

$endpoint = new stdClass();
$endpoint-&gt;disabled = FALSE; /* Edit this to true to make a default endpoint disabled initially */
$endpoint-&gt;api_version = 3;
$endpoint-&gt;name = 'user_service';
$endpoint-&gt;server = 'rest_server';
$endpoint-&gt;path = 'user_api';
$endpoint-&gt;authentication = array(
  'services' =&gt; 'services',
);
$endpoint-&gt;server_settings = array(
  'formatters' =&gt; array(
    'json' =&gt; TRUE,
    'bencode' =&gt; FALSE,
    'jsonp' =&gt; FALSE,
    'php' =&gt; FALSE,
    'xml' =&gt; FALSE,
  ),
  'parsers' =&gt; array(
    'application/json' =&gt; TRUE,
    'application/vnd.php.serialized' =&gt; FALSE,
    'application/x-www-form-urlencoded' =&gt; FALSE,
    'application/xml' =&gt; FALSE,
    'multipart/form-data' =&gt; FALSE,
    'text/xml' =&gt; FALSE,
  ),
);
$endpoint-&gt;resources = array(
  'user' =&gt; array(
    'operations' =&gt; array(
      'retrieve' =&gt; array(
        'enabled' =&gt; '1',
      ),
      'index' =&gt; array(
        'enabled' =&gt; '1',
      ),
    ),
    'actions' =&gt; array(
      'login' =&gt; array(
        'enabled' =&gt; '1',
      ),
      'logout' =&gt; array(
        'enabled' =&gt; '1',
      ),
      'token' =&gt; array(
        'enabled' =&gt; '1',
      ),
      'request_new_password' =&gt; array(
        'enabled' =&gt; '1',
      ),
      'register' =&gt; array(
        'enabled' =&gt; '1',
      ),
    ),
    'targeted_actions' =&gt; array(
      'password_reset' =&gt; array(
        'enabled' =&gt; '1',
      ),
    ),
  ),
);
$endpoint-&gt;debug = 1;


I am using basic PHP code for the testing purpose. Please have a look at the GIST.

The problem is that, while I run the test page, I can see it registers a new user and outputs the following.

stdClass Object
(
    [uid] =&gt; 14
    [uri] =&gt; http://vote-app.dd:8083/user_api/user/14
)


But while I try to log in with the same user (as per the code) it outputs the following error.


  Error
  ["Wrong username or password."]


I need some help on this. Am I missing something? 

I also checked https://www.drupal.org/node/1491754 and other Drupal pages for this too.
Found the solution. Just for future references for others and me as well :-)

There is an issue in Services module Wrong username and password, just after a creation of a user where someone faced the same problem. User login just registration. So as it stated,


  If you are anonymous user and register a user your register form does not have password field at all. It has only username and email fields. All instructions are sent by email (with token to log in and set the password). So register call actually does not set the password.


This is actually true. If I go to the admin and change the password again then it's working. So the solution is to alter two variables,

variable_set('user_email_verification', FALSE);
variable_set('user_register', TRUE);


This will now allow the users to register by themselves.