Page 1 of 1

PROBLEM WITH LOGIN VIA API CONNECTION

PostPosted: Tue Jul 25, 2017 3:28 pm
by deikalion
Hi Mr. Briggs

I am looking for your help as usual

I had set up login and new account with API connection. All been working fine but then suddenly for some reason Login stopped working. The thing is that as I am aware it is not API issue as I still can do a new account but login does not work. One of my mates said that sometimes he can login sometimes can not me personally I cant login using API login at all. I am pretty sure that there is no issue with PHP code.

I thought maybe there is something with Poker client as I have feeling that this issue started after I did update to version 5.14 however right now I done update to the latest one which is 5.16 but it still does not seem to be working..

Could you help at any point please?

Re: PROBLEM WITH LOGIN VIA API CONNECTION

PostPosted: Tue Jul 25, 2017 5:15 pm
by Kent Briggs
There haven't been any recent changes that should affect logins. How exactly are you performing the login? There are no login commands in the API itself (other than session key generation), it's all done via http links and URL parameters.

Re: PROBLEM WITH LOGIN VIA API CONNECTION

PostPosted: Tue Jul 25, 2017 5:35 pm
by deikalion
I think it is working in the way you just said creating session key. Please have a look at the code I use.

$server = "http://194.87.236.15:8087"; // set your site url here
include "API.php";
if (isset($_POST["username"]))
{
$player = $_POST["username"];
$password = $_POST["password"];
$params = array("Command" => "AccountsPassword", "Player" => $player, "PW" => $password);
$api = Poker_API($params);

if ($api -> Result != "Ok") die($api -> Error . "<br/>" . "Click Back Button to retry.");
if ($api -> Verified != "Yes") die("Password is incorrect. Click Back Button to retry.");
$params = array("Command" => "AccountsSessionKey", "Player" => $player);
$api = Poker_API($params);
if ($api -> Result != "Ok") die($api -> Error . "<br/>" . "Click Back Button to retry.");
$key = $api -> SessionKey;
$src = $server . "/?LoginName=" . $player . "&SessionKey=" . $key;
echo "<script>window.location.assign('$src')</script>";
}
?>

Basically this code is attached to the login form. Unfortunately I am not doing a code but I am hiring a freelancer which has knowledge of php coding but even he dont understand why it is not working.

Re: PROBLEM WITH LOGIN VIA API CONNECTION

PostPosted: Tue Jul 25, 2017 6:45 pm
by Kent Briggs
How exactly is it "not working"? What do you see on the screen? Do any of those "die" messages show? Is it making it all the way down to the window.location.assign command? Have you looked inside the API.php file to make sure the $url variable is still pointing to the right IP address?