Skip to main content
Version: 5.7.0

SmartSwitchAuthenticateUltra

Smart Switch Authenticate will logout of the current profile, and switch to the new authentication type.

In event the current session was previously a completely anonymous account, the smart switch will delete that profile (since completely anonymous accounts are irretrievable once you switch away from them).

Use this function to keep a clean designflow from anonymous to signed profiles.

Authenticate the user for Ultra.

ServiceOperation
authenticationV2AUTHENTICATE

Method Parameters

ParameterDescription
ultraUsernameIt's what the user uses to log into the Ultra endpoint initially
ultraIdTokenThe "id_token" taken from Ultra's JWT.
forceCreateShould a new profile be created for this user if the account does not exist?

Usage

http://localhost:3000
string ultraUsername = "ultraUsername";
string ultraIdToken = "ultraIdToken";
bool forceCreate = true;
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.SmartSwitchAuthenticateUltra(
ultraUsername, ultraIdToken, forceCreate, successCallback, failureCallback);
JSON Response
{
"status": 200,
"data": {
"vcPurchased": 0,
"experiencePoints": 100,
"refundCount": 0,
"playerSessionExpiry": 60,
"server_time": 1464621990155,
"experienceLevel": 0,
"currency": {
"credits": {
"purchased": 0,
"balance": 12211,
"consumed": 133,
"awarded": 12344
}
},
"abTestingId": 8,
"statistics": {
"gamesWon": 0
},
"id": "323e861-b749-4ce4-a57a-175232e21b5d",
"createdAt": 1459439058035,
"profileId": "323e861-b749-4ce4-a57a-175232e21b5d",
"newUser": "false",
"xpCapped": false,
"sent_events": [],
"timeZoneOffset": -5,
"playerName": "",
"vcClaimed": 0,
"parentProfileId": null,
"rewards": {
"rewardDetails": {},
"rewards": {},
"currency": {}
},
"countryCode": "ca",
"loginCount": 16,
"emailAddress": "test@ultraUsername.com",
"previousLogin": 1464621979514,
"incoming_events": [],
"lastLogin": 1464621990118,
"languageCode": "en",
"pictureUrl": null,
"sessionId": "v3grtg3ve0a089pekk8lneuk8k",
"amountSpent": 0
}
}