Jump to: navigation, search

Unified Login Verification

Revision as of 14:55, 22 October 2014 by Huangyanli (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Unified Login Verification

Unified login verification flowchart
1.Game client calls AnySDK framework login API, client pops up channel SDK login interface and corresponding channel SDK will internally send login request to channel platform server.
2.User login succeeds, channel SDK acquires the user ID and verification code returned by the channel platform server
3.AnySDK framework acquires user ID and verification from SDK and sends user login info. Verification request to the game server (the address of the requested API is the user login verification address that developers put on the packing toll channel parameter)
Note: the three steps above would be accomplished by AnySDK Framework without extra code from developers)
4.After receiving the parameter of the request from client, the game server would pass the user's information and other parameters to AnySDK server(PHP and Java demo code of operation of this step is provided below for reference or direct usage
(Note:Here the number and content of parameters that each SDK receives differ, so that the game server would need to pass all parameters requested to be verified to login.)
5.AnySDK server receives the request data from game server and conducts user login verification to corresponding channel platform servers.
6.AnySDK server receives the verification result of channel server and acquires the user's final AccessToken
7.AnySDK framework passes the returned verification result from channel server to the game client.
8.The game server returns verification result to AnySDK framework as well as some game logic related data to game client
9.AnySDK framework executes the login callback function to notify the game client if login succeeds.

Game Server Requests Login Verification

Encoding Instruction

When encoding coding characters of the server, you need to use utf-8 without bom to avoid possible data encoding errors that might result in failure of data analysis by the server; you can use notepad++ to conduct conversion.

Login Verification Url

http://oauth.anysdk.com/api/User/LoginOauth/ (Note: use post method with http protocol)

Login Verification Demo of the Server

1.php demo
2.java demo
3.nodejs demo

AnySDK Login Verification And Responding to Data

The data acquired by AnySDK login verification would all return in json format, including four subdomains: status、data、common and ext.
1.status:used to express if the request succeeded
2. data: saves the verification info. returned by the channel platform (the data format here might differ according to different implementation of different channels; some channels might return more user data then others, which only return the verification result; AnySDK returns these so that game server can acquire all the original verification; developers can choose to utilize them or ignore them, neither would influence their integration process in any way)
3common: including channel ID, SDK ID, user ID returned by channel (channel only), and the game server ID chosen by user before login (defaulted to be null unless the client has called a overriding login function with serverId). Developers should use this section as user data.
4. ext: null by default; game server can save game logic related data (such as user ID set internally by developer server) in ext domain, and these data will be acquired by game server when it receives the msg info. comes with the login callback and used to execute corresponding game logic.

Successful returning cases (take 360 as an example)


Failed returning cases:


Error Code