INVALID_USER_CREDENTIALS error from webservice when multiple user access simultaneously
INVALID_USER_CREDENTIALS error return from while using webservice
This error is triggering from include/Webservices/Login.php line 28
This error happens when multiple users using the webservice simultaneously
this error happens in this scenario. suppose we have a script get_tickets.php to list all tickets.
We authenticate with username and accesskey of admin in this script.
user1 comes and run the get_ticket.php . Obviously the script will be first doing the webservice login .
The script calls the getchallenge method and an auth tocken is generated on the databases.
before the script call the login method for user1 , user2 runs the get_tickets.php script and calls the get challenge method.
Now the authtocken get modified on the database. Hence the the auth tocken is not valid for user1 and he cannot login and this exception will returned
The issue is because of regenerating auth tocken on each login request. I am able to fix the issue by making the auth tocken static. It does not regenerate on each request