login via sessions key
login via sessions key
How i can do this plz help
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: login via sessions key
First create your own html login page on a web site for your players. You'll need to validate the login with your own code. Then call the AccountsSessionKey API command to get a session key for that player. From the help file:deisss wrote:How i can do this plz help
AccountsSessionKey - creates a random 80-bit session key for a player specified by the Player parameter. The session key serves as a one-time-only password for an automated login. See the Technical Information/Misc topic for instructions on using session keys. A typical response will look something like this:
Result=Ok
Player=Aces123
SessionKey=1234567890ABCDEF1234
Then pass that info to your poker server in the URL. From the help file:
LoginName and SessionKey - this is the preferred method for automated logins as it doesn't expose the player's password in the URL or the HTML wrapper. The Session Key is generated by the AccountsSessionKey API command and acts as a temporary password for the player as it can only be used once. You must generate a new key for every new login. This login method can be made mandatory with the "Require session keys" option in the Account Settings if you want to prevent players from bypassing your web interface and logging in manually. Example:
http://12.34.56.789:8087?LoginName=Aces ... ABCDEF1234
If you create an account at http://www.centpoker.com you can see a live example of this. After logging in, view the html page source and you'll see your SessionKey in an iframe tag.
Re: login via sessions key
I'm trying to do the exact same thing, but I have 0 api experience, so a little more help on what to do would be nice, like how do I call, and apply that to the login site, either under the html one or php login
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: login via sessions key
Try some of the PHP examples posted here to get familiar with making API calls and acting on the results returned:afmiller wrote:I'm trying to do the exact same thing, but I have 0 api experience, so a little more help on what to do would be nice, like how do I call, and apply that to the login site, either under the html one or php login
http://www.briggsoft.com/docs/pmavens/API_Examples.htm
Re: login via sessions key
Went and tried the automated login example the SessionKey, got this error
Warning: Cannot modify header information - headers already sent by (output started at /home/afmiller/public_html/poker/Sessionkey.php:4) in /home/afmiller/public_html/poker/Sessionkey.php on line 21
Warning: Cannot modify header information - headers already sent by (output started at /home/afmiller/public_html/poker/Sessionkey.php:4) in /home/afmiller/public_html/poker/Sessionkey.php on line 21
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: login via sessions key
In that particular example, which uses a PHP redirection header() command, there can't be any other output before it. Make sure you have no other display elements in your code. In a more elaborate implementation, you would probably have PHP generate a page which embeds an iframe that points to your poker server and then you could put custom output around that iframe.afmiller wrote:Went and tried the automated login example the SessionKey, got this error
Warning: Cannot modify header information - headers already sent by (output started at /home/afmiller/public_html/poker/Sessionkey.php:4) in /home/afmiller/public_html/poker/Sessionkey.php on line 21
Re: login via sessions key
I just took the coding straight from the example, I didnt add anything fancy, just wanna get the basics down for now
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: login via sessions key
It should have worked (it did for me). Unfortunately I'm travelling for Thanksgiving and won't have access to my main development computer until Monday. Is there any output at all showing before that error appears? Try removing the html and body tags and see if that makes a difference. Also try some of the other examples, which don't use any header commands.afmiller wrote:I just took the coding straight from the example, I didnt add anything fancy, just wanna get the basics down for now
Re: login via sessions key
No, I just copied and pasted what was on the api examples for it. I removed the html and body tags, still no luck, but the normal HTML one works but I would like to use the Session Key. I tried the create account php example and that works fine, just seem to be having a problem with the php Session Key. I do have the API.php file in the root folder which is modified for my current settings