Mobile App Integration Manual v1.0.0

Technical Guide

1.Introduction

This document is to illustrate the detail of the integration required for a client going to integrate into our platform with Mobile App

2.Version

VersionDescriptionDate
1.0.0Initial version2019/05/10

3.Integration

In order to let your player log in through our mobile app, you have to implement a “User authentication interface” in your system to verify the player.

In the mobile app, a player must log in by your platform’s username ending with ‘@’ and your unique suffix, which we will provide you. For example, a player with username peter1235 and the lobby with suffix ‘ab’, he should enter the username as ‘peter1235@ab’. The password will be the same as in your platform. We will use the suffix to identify your “User authentication interface” in your website to verify the player.

4.API Requirements

You have to implement an API to allow our platform to call.

We will POST two parameters to the URL provided by the client:

  1. q – an encrypted string containing username (without ‘@’ and suffix), password and date/time. We will send you the key of encryption.
  2. s – the md5 string of username, password and date/time

String QS = “username=tester1&password=123456&datetime=20151020145031”;
String q = DESEncrypt(QS);
String s = BuildMD5(QS);
String post = “q=” + HttpUtility.UrlEncode(q) + “&s=” + s;

It will make a POST request to web link you provided.

4.1.ASP.Net C# version

Example DES Encrypt/Decrypt function in ASP.Net C# :

Example MD5 function in ASP.Net C#:

4.2.PHP version

DES Encrypt/Decrypt function in PHP:

4.3.Usage of String q and s

Your API received the q and s parameters should decode the q and verify it’s md5 with the s. If the verification passed, the client should check against their own system.  If the username exists in your platform, you should call SA Gaming API “LoginRequest” to receive a login token for the user. If the user doesn’t exist in our platform, we will create one. If LoginRequest success, you should receive an XML for the result with the token. Please refer to “SA Gaming Web Service API – Technical Guide” for details.

Result:
NameDescriptionType and LimitRequired?
datetimeDate time as passed in beforeDateTimeY
status0: Success
1: Username/Password error
2: Network error
3: Account error
4: API closed
IntegerY
tokenLogin token return from LoginRequeststringY

4.4.API Logic

The following action should be taken after received our request:

  1. Decrypt q parameter, verify with the md5 for the correctness
  2. Verify the Username and Password.
  3. Call SA Gaming API to request login token (LoginRequest).
  4. Return the required XML to SA Gaming server

Logic flow diagram:

5.Error code

Error codeDescription
1007Account not existing
1010Error during authentication
1012Authentication response empty
1013Authentication response incorrect
1014Authentication data incorrect
1015Username or password error
1016Network error
1017Account error
1018Authentication API closed
1019Authentication URL not existing
1020Authentication response parsing error
1021Pattern not existing
1022Pattern incorrect
1023Account locked
1024Location restricted
1025System under maintenance
9999Unknown error

Suggest Edit