login via sessions key

For discussion of the Poker Mavens server module and other administration topics
deisss
Posts: 31
Joined: Sun Aug 30, 2009 6:10 am

login via sessions key

Post by deisss »

How i can do this plz help
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: login via sessions key

Post by Kent Briggs »

deisss wrote:How i can do this plz help
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:

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.
deisss
Posts: 31
Joined: Sun Aug 30, 2009 6:10 am

Re: login via sessions key

Post by deisss »

thx kent
afmiller
Posts: 5
Joined: Tue Nov 23, 2010 10:32 pm

Re: login via sessions key

Post by afmiller »

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
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: login via sessions key

Post by Kent Briggs »

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
Try some of the PHP examples posted here to get familiar with making API calls and acting on the results returned:

http://www.briggsoft.com/docs/pmavens/API_Examples.htm
afmiller
Posts: 5
Joined: Tue Nov 23, 2010 10:32 pm

Re: login via sessions key

Post by afmiller »

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
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: login via sessions key

Post by Kent Briggs »

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
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
Posts: 5
Joined: Tue Nov 23, 2010 10:32 pm

Re: login via sessions key

Post by afmiller »

I just took the coding straight from the example, I didnt add anything fancy, just wanna get the basics down for now
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: login via sessions key

Post by Kent Briggs »

afmiller wrote:I just took the coding straight from the example, I didnt add anything fancy, just wanna get the basics down for now
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
Posts: 5
Joined: Tue Nov 23, 2010 10:32 pm

Re: login via sessions key

Post by afmiller »

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
Post Reply