Standard Integration

If you have a site using WordPress we recommend using the ready-made plugin, otherwise this page describe how to integrate manually.

How it works – overview

In order for one of your users to be logged in on the Cubeia Social poker server we need authentication against your site is required. In short it works like this:

  1. You setup the integration end point used by Cubeia Social.
  2. The player logs into your site and clicks a “play now” link or similar. In this link you include a token which you can recognize him with later.
  3. When the Cubeia Social game server accept the player it makes a HTTP GET call back to your site which include the token from #2.
  4. You verify the token and answer with a simple JSON construct containing user details.

 

Manual Integration

1: Configuration

Go to your operator-page on this site and make a note of your operator id. Submit an integration URL that will be used to for the authentication call back.

Example: You have a site that is running at www.uniquepoker.com and you want us to route the callbacks to www.uniquepoker.com/cubeia-social, then you should configure integration URL as below.

http://www.uniquepoker.com/cubeia-social/

The configured integration URL will be represented by <integrationUrl> below.

2: Link to the Poker Client

Create a link from your site to the poker client. According to this format:

https://csplb1.cubeia.com/poker-client/poker/login/<operatorId>/<authToken>

In the above link there are two substitutions you need to make:

  • “<operatorId>” should be substituted for your operator ID which you can find at your operator page
  • “<authToken>” should be substituted for a session token identifying the user.

The Auth Token should be generated separately by your system for each user which logs in, for example by creating a random UID or number. If your operator ID is “666” and you generate the Auth Token “asldj7dj” for the logged in user, the entire URL will look like this:
[fusion_code]https://csplb1.cubeia.com/poker-client/poker/skin/cubeiaclassic/operator/666/token/asldj7dj[/fusion_code]

3: Recieve the callback from Cubeia Social

When Cubeia Social is called from the link above it will make a callback to your server in order to authenticate the user. We will make a standard HTTP GET call to the following URL:

<integrationUrl>/authenticate/<authToken>

In the above “<integrationUrl>” is obviously your domain, and “<authToken>” is the same Auth Token as you generated for the user in #2. If your domain is “nadapoker.com”, the integration URL is http://www.nadapoker.com/cubeia-social and with an Auth Token from the previous example, the URL Cubeia Social will call is:

http://www.nadapoker.com/cubeia-social/authenticate/asldj7dj

4: Respond to the callback

If the Auth Token is correct you should now answer with a JSON construct like so:

{
   "id":"...",
   "username":"...",
   "avatarUrl":"http://tinyurl.com/nmquhrf"
   "userAttributes" : { "attribute1" : "value1" }
}

*avatarUrl is optional
*userAttributes is optional

The ID is used for reporting and should be unique within your user database. The username will be used as a display name in the poker, as well as a tool for debugging. The above construct should be returned with an HTTP OK status (200) and the content type “application/json”. So as an example, if the user ID is “42” and the username “Adams” then the response would be:

HTTP/1.1 200 OK
Content-Type: application/json
[...]
{
   "id":"42",
   "username":"Adams",
   "avatarUrl":"http://tinyurl.com/nmquhrf"
}

If however, the Auth Token is not correct or some other problem occurs you should indicate this with any other HTTP status code such as “500 Internal Server Error” with one exception. If the user is not allowed to play for some reason (such as he’s token being expired or he’s being blocked), then answer:

  • “401 Unauthorized” – The token is incorrect or the user should not be allow to play.

Troubleshooting

If authentication is not working, you can start troubleshooting by checking your logs. To do this go to the operator page and click on the logs tab (make sure you are logged in first!).