SmartSwitchAuthenticateNintendo
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 on Nintendo Switch.
Service | Operation |
---|---|
authenticationV2 | AUTHENTICATE |
Method Parameters
Parameter | Description |
---|---|
nintendoAccountId | The Nintendo Network Services Account (NSA) ID for the user |
nintendoAuthToken | An NSA ID token retrieved via the NintendoSDK |
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
- Cloud Code
- Raw
string nintendoAccountId = "nsaid"; // Network Services Account ID
string nintendoAuthToken = "nsaToken";
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.SmartSwitchAuthenticateNintendo(
nintendoAccountId, nintendoAuthToken, forceCreate, successCallback, failureCallback);
const char* nintendoAccountId = "nsaid"; // Network Services Account ID
const char* nintendoAuthToken = "nsaToken";
bool forceCreate = true;
_bc->smartSwitchAuthenticateNintendo(
nintendoAccountId,
nintendoAuthToken,
forceCreate,
this);
// N/A
// N/A
// N/A
// N/A
// N/A
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": "",
"previousLogin": 1464621979514,
"incoming_events": [],
"lastLogin": 1464621990118,
"languageCode": "en",
"pictureUrl": null,
"sessionId": "v3grtg3ve0a089pekk8lneuk8k",
"amountSpent": 0
}
}