Validation API
Server side integration
The second phase of integration involves the validation API, which facilitates the actual authorization process by SARD. This entails establishing communication between the SARD server and the Game server through an API. The first one is Validation API. Through this functionality, player validation occurs which determines whether player has SARD active.
Validation process
Validation process works following way as described on schema
- User is authorized by game-server
- Game-client calls
SetUserName
- During the next period of time in not particular order:
- Game-server calls validation API
- SARD-client component sends information about user to SARD-server
- After both the request and client-data are received by SARD-server (or after certain amount of time one of them is missing), validatior either:
- Does nothing if data from client and server matches
- Sends kick API call to game server if didn't receive matching data from game-client (refer to Applying sanctions for details on Kick API)
- Sends kick to SARD-client in case didn't get API-call from the server
Validation implementation
To integrate the validation service API within your game server, you need to make a call to our API endpoint during player's connection to game server:
Sample request
curl -X POST https://validation.sard.ac/api/XXX/validate \
-H "Authorization: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
-H "Content-Type: application/json" \
-d '{"username": "XXXX"}'
- URL: Validation endpoint, where XXX represents unique number for your environment
- Authorization: Token provided to you in Admin panel
- Data: SARD server expects to receive the same username that was provided to SARD in game-client with the
SetUserName