SmartSwitchAuthenticateSteam
Smart Switch Authenticate will logout of the current profile, and switch to the new authentication type. In event the current session was previously an anonymous account, the smart switch will delete that profile. Use this function to keep a clean designflow from anonymous to signed profiles
Authenticate the user using a steam userId and session ticket (without any validation on the userId).
Method Parameters
Parameter | Description |
---|---|
userId | String representation of 64 bit steam ID |
sessionTicket | The session ticket of the user (hex encoded) |
forceCreate | Should a new profile be created for this user if the account does not exist? |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string steamId = "userSteamId";
string ticket = "sessionTicketFromSteam";
bool forceCreate = true;
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("[Authenticate Success] {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("[Authenticate Failed] {0} {1} {2}", status, code, error));
};
_bc.SmartSwitchAuthenticateSteam(
steamId, ticket, forceCreate,
successCallback, failureCallback);
const char* steamId = "userSteamId";
const char* ticket = "sessionTicketFromSteam";
_bc->smartSwitchAuthenticateSteam(
steamId, token, true, this);
NSString* userID = @"userSteamId";
NSString* sessionticket = @"sessionTicketFromSteam";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[_bc smartSwitchAuthenticateSteam:userID
sessionTicket:sessionticket
forceCreate:true
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
Steam steamId = "userSteamId";
Steam ticket = "sessionTicketFromSteam";
_bc.smartSwitchAuthenticateSteam(
steamId, token, true, this);
var steamId = "userSteamId";
var ticket = "sessionTicketFromSteam";
var forceCreate = true;
_bc.smartSwitchAuthenticateSteam(steamId, ticket, forceCreate, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var steamId = "userSteamId";
var sessionTicket = "sessionTicketFromSteam";
var forceCreate = true;
ServerResponse result = await _bc.smartSwitchAuthenticateSteam(
userid:steamId,
sessionticket:sessionTicket,
forceCreate:forceCreate);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
// N/A
// N/A
JSON Response
var steamId = "userSteamId";
var ticket = "sessionTicketFromSteam";
var forceCreate = true;
_bc.smartSwitchAuthenticateSteam(steamId, ticket, forceCreate, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});