CreateSettopHandoffCode
Creates a settop handoff code that is valid for a limited amount of time, and in accordance with the provided specifications. Use the AuthenticateSettopHandoff
call to log the user in via the generated code.
Service | Operation |
---|---|
identity | CREATE_HANDOFF_ID |
Method Parameters
Parameter | Description |
---|---|
numChars | Number of entries in the generated code |
validSecs | Number of seconds that the code should be valid for. |
handoffJson | Custom JSON object - will be returned when the user logs in via AuthenticateSettopHandoff |
stringPool | The pool of characters (or phrases) to use to generate the random code. Use this value to constrain the code to digits, or digit-like phrases (i.e. "0n3", "tw0", etc.) |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
var identityProxy = bridge.getIdentityServiceProxy();
var handoffJson = { "fromApp": "launcher" };
var stringPool = [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" ];
var postResult = identityProxy.createSettopHandoffCode(
6, // numChars
180, // validSecs
handoffJson, // handoffJson
stringPool // stringPool
);
if (postResult.status == 200) {
// Success!
var code = postResult.data.handoffCode;
}
// Cloud Code only. To view example, switch to the Cloud Code tab
JSON Response
{
"data": {
"handoffCode": "105175"
},
"status": 200
}