Hello Ali,
thank you for your answer. I really appreciate that and you are absolutely right.
I just changed my service to the following one and it is working properly:
$http({
method: 'POST',
url: api_url + 'auth/generate_auth_cookie/?nonce=' + data.nonce + '&username=' + encodeURIComponent(username) + '&password=' + encodeURIComponent(password)
}).
success(function(data, status, headers, config) {}).
error(function(data, status, headers, config) {});
Thanks again
George