Come2Play Channel-SSO v0.22 SSO Single Sign-On for registered user integration: Your site will contain an iframe with your Come2Play Channel's authentication URL. For each user please provide user detail parameters: Channel SSO URL: http://www.come2play.com/channel_auth.asp Parameters: Param No. Type Name Description 1 Integer channel_id Required. Your Channel's unique identity at Come2Play. 2 Integer uid Required. The player's unique identity. e.g: 123456 3 String nick_name Required. The player's display name. e.g: The Man 4 String auth_sig Required. MD5 hash of : uid + channel_key About MD5 and implementation source code 5 String avatar_url *Optional* URL of player's display image. Image size should be 70x70. Only JPG GIF are supported e.g.:http://www.yoursites.com/avatars/123456.gif 6 String first_name *Optional* Player's first name. e.g.: John 7 String last_name *Optional* Player's last name. e.g.: Smith 8 Enumerated sex *Optional* Player's gender. Accepted values: male or female 9 String country *Optional* Player's country 2-chars-abbreviation. Max 2 Characters allowed. e.g.: US 10 String city *Optional* Player's city. e.g.: New York City 11 String state *Optional* Player's state 2-chars-abbreviation. Max 2 Characters allowed. e.g.: NY 12 Integer Zip code *Optional* Player's Zip-Code location. Max 5 digits allowed. e.g.: 10001
13 String next_url *Optional* URL which player will be redirected to after login is complete. If not specified the default is the current channel's gallery. Simple Example: Let's say you are the administrator of channel_id=9000 Your channel_key is : abcdefghijklmnop Your Channel_Id and Channel_Key are available through the Channel Customize Advanced form. The following user has logged onto your site and you want to grant him game channel entry: uid=123456 Next, construct the auth_sig, using the following configuration: auth_sig = md5(uid+channel_key) auth_sig=md5(123456abcdefghijklmnop) auth_sig=dc952e4371e04551684afbcbf12cf14c Finally, move all four parameters to Channel- SSO URL inside the channel's iframe. Don t forget to use URLEncode for each parameter's value. The result is the following Channel- SSO URL: http://www.come2play.com/channel_auth.asp?channel_id=9000&uid=123456&nick_name =The+Man&auth_sig= dc952e4371e04551684afbcbf12cf14c Full Example:
Now that you understand the basics, let's apply the same principles to setting values for all parameters. You are still the administrator of channel_id=9000 Your channel's key is: abcdefghijklmnop User Details: Uid=123456 avatar_url=http://www.yoursites.com/avatars/123456.gif first_name John last_name=smith =male country=us city=new York state=ny zipcode=10001 We would also like the user to see his/her statistics page when first logging onto the channel. For this purpose we'll apply the next_url parameter to the URL: next_url= /player_gallery_frame.asp?channel_id=9000&t=4 t=4 means Statistics tab. Get more info here Next, construct the auth_sig, using the following equation: auth_sig = md5(uid+channel_key) auth_sig=md5(123456abcdefghijklmnop) auth_sig=dc952e4371e04551684afbcbf12cf14c Finally, apply all parameters to Channel- SSO URL inside the channel's iframe. Don t forget to use URLEncode for each parameter's value. The result is the following Channel-SSO URL: http://www.come2play.com/channel_auth.asp?channel_id=9000&uid=123456&nick_name =The+Man&first_name=John&last_name=Smith&gender=male&country=US& city=new+york&zipcode=10001&next_url=%2fplayer_gallery_frame.asp%3fchannel_id%3 D9000%26t%3D4&auth_sig=dc952e4371e04551684afbcbf12cf14c
Matching Method Type You can also match between players by applying method_type=matching to the Channel SSO URL, in this case termed Matching SSO URL. You'll also need to apply it to the appropriate match parameters. Matching SSO URL: http://www.come2play.com/channel_auth.asp?method_type=matching&{matchingparams} Below is a summary of all accepted parameters for the matching method type. Parameters: Param No. Type Name Description 1-3, 5-12 - - Param No. 1-3, 5-12 mentioned on above SSO - single-sign-on for registered users integration. 14 Enumerated method_type *Optional* Accepted values: login or matching. 15 Comma separated array 16 0-1000 integer matching_uids matching_stake If not supplied, default will be login and all match parameters will be ignored. *Optional* Contains the matching players' unique identity. e.g.: 123456,123457 If not supplied, we will perform auto-matching between two available players. *Optional* No. of tokens attached to this matching. Allowed range is 0-1000. e.g.: 100 If not supplied, default is "0". 17 Integer matching_game_id *Optional* The game's unique identity at Come2Play platform, e.g.: 2 (Chess) If not supplied, default is "1" (Backgammon) 4 String auth_sig Required. MD5 hash of : uid + matching_uids + matching_stake + matching_game_id + channel_key About MD5 and implementation source code
Example: If you are the administrator of channel_id= 9000 And your channel_key is : abcdefghijklmnop (Your Channel_Id and Channel_Key are available through Channel's Customize Advanced form.) And you want to perform a Chess match between two of your players. The chosen stakes are 100 tokens and these are the players: Player 1: Uid=123456 Player2: Uid=123457 nick_name=the Kid You'll need to send each player his own Game Window SSO URL. The URL for Player 1 will contain the following parameters: Uid=123456 method_type=matching matching_uids=123456,123457 (Note that uids order MUST be exactly the same for both URL's) matching_stake=100 matching_game_id=2 ("2" is the game identity for the Chess game on Come2Play's platform) Next we need to construct the auth_sig, using the following equation: auth_sig = md5(uid + matching_uids + matching_stake + matching_game_id + channel_key) auth_sig=md5(123456123456,1234571002abcdefghijklmnop) auth_sig=a088acbcf8bf1c8d59f8510dfa8b4732 Pass all Player 1 parameters to Channel- SSO URL inside the game window iframe. Don t forget to apply URLEncode to each parameter's value.
The result is the following Matching SSO URL: http://www.come2play.com/channel_auth.asp?channel_id=9000&uid=123456&nick_name =The+Man&method_type=matching&matching_uids= 123456%2C123457&matching_stake=100&matching_game_id=2& auth_sig=905ab617a45fab8628fb185e66f62918 The URL for Player 2 will contain the following parameters: Uid=123457 nick_name=the Kid method_type=matching matching_uids=123456,123457 (see how the uid order is exactly the same for both players) matching_stake=100 matching_game_id=2 Next, construct the auth_sig, using the following equation: auth_sig = md5(uid + matching_uids + matching_stake + matching_game_id + channel_key) auth_sig=md5(123457123456,1234571002abcdefghijklmnop) auth_sig=097d6ad7d8dc17736629330abd2773d1 Finally, apply all Player 2 parameters to Channel- SSO URL inside the game window iframe. Don t forget to apply the URLEncode to each parameter's value. The result is the following Matching SSO URL: http://www.come2play.com/channel_auth.asp?channel_id=9000&uid=123457&nick_name =The+Man&method_type=matching&matching_uids= 123456%2C123457&matching_stake=100&matching_game_id=2& auth_sig=097d6ad7d8dc17736629330abd2773d1 - End -